我正在尝试使用 graph_tool 中的 graph_draw 方法。我在 site_packages 和文档中看到了对它的引用
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: graph_draw
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py:__all__ = ["graph_draw", "graphviz_draw", "fruchterman_reingold_layout",
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: >>> gt.graph_draw(g, pos=pos, output="graph-draw-fr.pdf")
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: gt.graph_draw(g, pos=pos, output="graph-draw-fr.png")
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: >>> gt.graph_draw(g, pos=pos, output="graph-draw-arf.pdf")
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: gt.graph_draw(g, pos=pos, output="graph-draw-arf.png")
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: graph_draw(u, mivs, vertex_fillcolor=mivs)
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: >>> gt.graph_draw(g, pos=pos, output="graph-draw-sfdp.pdf")
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: gt.graph_draw(g, pos=pos, output="graph-draw-sfdp.png")
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: http://www.mathematica-journal.com/issue/v10i1/graph_draw.html
./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: #graph_draw(u, pos)
但是当我尝试访问它时,它不存在......
>>> x=graph_tool.draw.GraphView
>>> x=graph_tool.draw.graph_draw()
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd_exec.py", line 3, in Exec
exec exp in global_vars, local_vars
File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'graph_draw'
我错过了什么吗?我应该如何访问这个?
谢谢!