[Numpy-discussion] plt.show() and plt.draw() doesnt work

Ralf Gommers ralf.gommers at gmail.com
Sun Jul 13 08:11:07 EDT 2014


On Sat, Jul 12, 2014 at 6:53 PM, Josè Luis Mietta <
joseluismietta at yahoo.com.ar> wrote:

> Hi experts!
>
> I have a numpy array M. I generate a graph using NetworkX and then I want
> to draw this graph:
>
>     import networkx as nx
>     import matplotlib.pyplot as plt
>     G=nx.graph(M)
>     nx.draw(G)
>     plt.draw()
>
> Doing this, no picture appears. In addition, if I do `plt.show()` no
> picture appears.
>

You're getting a TypeError I guess? The third line is incorrect, should be
    G = nx.graph.Graph(M)

If that's not the issue and it's really about plotting, you should ask on
the matplotlib users list.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140713/9022f4da/attachment.html>


More information about the NumPy-Discussion mailing list