Draw function

Hi,
Many thanks.
I tried to use this new code, but nothing to do.
The error remains the same.
DO you have other suggestions please?
Thanks.
Nico

(first reply mistakenly went only to Giandomenico)

Hi,

I have a guess. I didn't download NetworkX to give it a try, but both
pylab and networkx have draw() functions, and the example just does a
"from blah import *" for both. At a guess, the pylab draw() function
is clobbering the intended NetworkX draw() function. Try this:

try:
   import pylab # DON'T DO: from pylab import *
except:
   print "pylab not found: see

https://networkx.lanl.gov/Drawing.html for info"

   raise

from networkx import *

G=grid_2d_graph(4,4) #4x4 grid
pos=spring_layout(G)
draw(G,pos,alpha=0.5,with_labels=False)
draw(G,pos,nodelist=[1,2,3,4],node_color='b') # blue
pylab.savefig("grid.png") # save as png
pylab.show() # display

> File "draw_colors.py", line 27, in ?
> draw(G,pos,node_color=array([G.degree(v) for v in G]))
> TypeError: draw() takes exactly 1 non-keyword argument (2 given)

--
Charles R. Twardy

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log

files

for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD

SPLUNK!

···

Il giorno mar, 10/01/2006 alle 14.20 -0500, Charles R. Twardy ha scritto:

http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users