I just updated matplotlib to 1.1.0 on my system and it now allows me to save to jpg with savefig
.
To upgrade to matplotlib 1.1.0 with pip
, use this command:
pip install -U 'http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.tar.gz/download'
EDIT (to respond to comment):
pylab
is simply an aggregation of the matplotlib.pyplot and numpy namespaces (as well as a few others) jinto a single namespace.
On my system, pylab
is just this:
from matplotlib.pylab import *
import matplotlib.pylab
__doc__ = matplotlib.pylab.__doc__
You can see that pylab
is just another namespace in your matplotlib installation. Therefore, it doesn't matter whether or not you import it with pylab
or with matplotlib.pyplot
.
If you are still running into problem, then I'm guessing the macosx backend doesn't support saving plots to jpg. You could try using a different backend. See here for more information.