For the life of me, I can not get matplotlib to display graphs in ipython inactively.
I've tried two approaches - each time, I get the same results:
In [10]: plot([1,2,3])
Out[10]: [<matplotlib.lines.Line2D at 0x104e9ca50>]
Here are the two approaches I have tried so far: Using the documentation as a guide, I tried two different approaches:
First:
ipython --pylab
plot([1,2,3])
xlabel('hi mom')
In [3]: plot([1,2,3])
Out[3]: [<matplotlib.lines.Line2D at 0x107e369d0>]
Second:
ipython
import numpy
import pylab
In [5]: pylab.plot([1,2,3])
Out[5]: [<matplotlib.lines.Line2D at 0x104ca7b90>]
How do I get the plot to display?
pylab.show(), or if you want them to pop up automatically, callpylab.ion()before creating a figure.In [6]: pylab.ion() In [7]: pylab.plot([1,2,3]) Out[7]: [<matplotlib.lines.Line2D at 0x101d59b90>] In [8]: pylab.show()ssh), be sure you've enabled X-forwarding.