[IPython-User] How to control the qulity of embedded figures in ipython notebook --pylab
Mon Oct 31 11:37:05 CDT 2011
2011/10/31 Bernard Uguen <firstname.lastname@example.org>
> 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
> Best regards,
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User