i am new to this community(first day), i dont know this is the correct
place for my problem.

here is my question, without an introduction, with networkx and sage..

if you run the following code in sage you get an image of what it
meant.

however if you run it again, you get new image overlapped with the old
one.!!!!!

can networkx or sage or matplotlib have a feature to solve this in
SAGE (not in python(it works), as i have the other part of my
algorithm in sage)

i have written a simple code to show the problem, not my actual steps
in between

my problem is to plot such a graph created, in SAGE.

Thank you
p2


#################################################
import matplotlib.pyplot as plt
import networkx as nx


G=nx.balanced_tree(2,1)
pos=nx.spring_layout(G) # positions for all nodes

# Full graph
nx.draw_networkx_edges(G,pos)
nx.draw_networkx_nodes(G,pos)

V=G.nodes()
# these are simple steps
L1=V[:2]
L2=V[2:]


# nodes color
nx.draw_networkx_nodes(G,pos,nodelist=L1,node_color='g')
nx.draw_networkx_nodes(G,pos,nodelist=L2,node_color='b')


#My qstn is How to plot it in sage

plt.savefig("labels_and_colors.png")



#####################################

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to