I just installed matplotlib in Ubuntu 9.10 using the synaptic package system. However, when I try the following simple example
>>> from pylab import plot;
>>> plot([1,2,3],[1,2,3])
[<matplotlib.lines.Line2D object at 0x9aa78ec>]
I get no plot window. Any ideas on how to get the plot window to show?
--pylab
no longer works for Jupyter, but fortunately we can add a tweak in theipython_config.py
file to get bothpylab
as well asautoreload
functionalities.The code snippet below works on both Eclipse and the Python shell:
Another possibility when using easy_install is that you need to require the most recent version of matplotlib. Try:
before you import matplotlib or any of its modules.
If you encounter an issue in which
pylab.show()
freezes the IPython window (this may be Mac OS X specific; not sure), you can cmd-c in the IPython window, switch to the plot window, and it will break out.Apparently, future calls to
pylab.show()
will not freeze the IPython window, only the first call. Unfortunately, I've found that the behavior of the plot window / interactions with show() changes every time I reinstall matplotlib, so this solution may not always hold.