draw overlaid subgraphs?

13 views
Skip to first unread message

Reckoner

unread,
Oct 28, 2008, 1:23:44 PM10/28/08
to networkx-discuss
I am trying to draw a big graph with certain subgraphs overlaid on it
in different colors. I've having trouble lining up a constituent
drawings using draw_shell.

Am I going about this the right way? I really need to see a picture of
the big graph with the little constituent subgraphs colored.

thanks.

Dan Schult

unread,
Oct 28, 2008, 2:39:45 PM10/28/08
to networkx...@googlegroups.com
For lining up two pictures of networks (for an overlay effect) make
sure you use the same pos (position) dict for each network. You
clearly have to have the same name for the nodes in each graph. See:
https://networkx.lanl.gov/browser/networkx/trunk/doc/examples/
draw_colors.py

Another approach is to make a single picture with the nodes and edges
colored according to which subgraph they belong. Here you want to
make a list/array of color values in the order of the nodes they
correspond to. See:
https://networkx.lanl.gov/browser/networkx/trunk/doc/examples/
draw_colormap.py

Edges are similar:
https://networkx.lanl.gov/browser/networkx/trunk/doc/examples/
draw_edge_colormap.py

Dan

Reply all
Reply to author
Forward
0 new messages