Need 3d graphics library in python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Appu2008
    New Member
    • Dec 2007
    • 18

    Need 3d graphics library in python

    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_fro m([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.
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    You have to include the networkx.drawin g library to make use of draw, draw_random, draw_circular, and draw_spectral .

    Comment

    • Appu2008
      New Member
      • Dec 2007
      • 18

      #3
      Originally posted by jlm699
      You have to include the networkx.drawin g 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.drawin g, 398 and will be imported if possible.

      Is this is wht u meant ????
      from networkx.drawin g 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..

      Comment

      • Appu2008
        New Member
        • Dec 2007
        • 18

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

        Thanx..

        Comment

        Working...