[IPython-User] How to control the qulity of embedded figures in ipython notebook --pylab

MinRK benjaminrk@gmail....
Mon Oct 31 11:37:05 CDT 2011

2011/10/31 Bernard Uguen <bernard.uguen@univ-rennes1.fr>

> Hi all,
> I really enjoy playing with ipython notebook that I find great.
> Thank you for this tool.
> Does somebody could explain how it is possible to control the dpi quality
> of the png figures which are embedded
> in the notebook.

The png figures are generated by regular matplotlib export.  IPython's
integration just involves triggering that export, and sending that over the
wire.  This means that you change the size of figures in exactly the same
you do for any matplotlib figure:

matplotlib.rcParams['figure.figsize'] = (8,5)

Or, if you are in pylab mode, we provide an easy proxy to this:


Unfortunately, IPython currently hardcodes 72dpi as the export resolution,
but I will change that shortly, so that it is only set as the *default*,
rather than immutable as it is currently.

And once I fix the hardcoded dpi, you will be able to change that with:

rcParams['savefig.dpi'] = 120, which governs the resolution of PNG export
in matplotlib (note that if you use SVG, I believe that is insensitive to
DPI settings).


> Best regards,
> Bernard
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20111031/b1505b36/attachment.html 

More information about the IPython-User mailing list