By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

Need 3d graphics library in python

P: 18
Hi all,
Iam a newbie in python and i need a library that supports 3D graphics in Python. My requirement is to construct a network (graph) out of it..I installed Networkx. This is a simple program i tried out ..The error iam getting is

Program
-------------
import networkx as NX
from networkx import *

G=Graph()
G.add_node(1)
G.add_nodes_from([2,3])
G.add_edge((1,2))
draw(G)

Error
--------
================================

Traceback (most recent call last):
File "C:/Python25/test.py", line 8, in <module>
draw(G)
NameError: name 'draw' is not defined


Tell me whether i hv to include any other library , inorder for the drawing functions in Networkx to work correctly.
Apr 2 '08 #1
Share this Question
Share on Google+
3 Replies


jlm699
100+
P: 314
You have to include the networkx.drawing library to make use of draw, draw_random, draw_circular, and draw_spectral .
Apr 2 '08 #2

P: 18
You have to include the networkx.drawing library to make use of draw, draw_random, draw_circular, and draw_spectral .

Hi,
Thanx for the reply. In the documentation of networkx , they says that
NetworkX does not provide sophisticated graph drawing tools. We
396 do provide elementary drawing tools as well as an interface to use the
397 open source Graphviz software package. These reside in networkx.drawing, 398 and will be imported if possible.

Is this is wht u meant ????
from networkx.drawing import * ..Pls forgive me to ask these simple qns..Also pls tell me is it possible to create 3d graphics in networkx

Thanx in advance..
Apr 3 '08 #3

P: 18
Hi,
I got it working right ... The problem was i hv not yet downloaded the packages like matplotlib,numpy etc. I more important qn. to ask u..Is it possible to draw 3d graphs in it ..

Thanx..
Apr 3 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.