From 7bb159caa9507f299f9fffcdf363238c9bb6075e 2014-02-21 06:07:53 From: MinRK Date: 2014-02-21 06:07:53 Subject: [PATCH] read InlineBackend defaults in set_matplotlib_formats --- diff --git a/IPython/core/display.py b/IPython/core/display.py index 6c48c6b..3af9699 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -729,20 +729,26 @@ def set_matplotlib_formats(*formats, **kwargs): To set this in your config files use the following:: - c.InlineBackend.figure_formats = {'pdf', 'png', 'svg'} - c.InlineBackend.quality = 90 + c.InlineBackend.figure_formats = {'png', 'jpeg'} + c.InlineBackend.print_figure_kwargs.update({'quality' : 90}) Parameters ---------- - *formats : list, tuple - One or a set of figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'. - quality : int - A percentage for the quality of JPEG figures. Defaults to 90. + *formats : strs + One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'. + **kwargs : + Keyword args will be relayed to ``figure.canvas.print_figure``. """ from IPython.core.interactiveshell import InteractiveShell from IPython.core.pylabtools import select_figure_formats + from IPython.kernel.zmq.pylab.config import InlineBackend + # build kwargs, starting with InlineBackend config + kw = {} + cfg = InlineBackend.instance() + kw.update(cfg.print_figure_kwargs) + kw.update(**kwargs) shell = InteractiveShell.instance() - select_figure_formats(shell, formats, quality=90) + select_figure_formats(shell, formats, **kw) @skip_doctest def set_matplotlib_close(close):