@@ -275,19 +275,32 @@ def set_matplotlib_formats(*formats, **kwargs):
275275
276276 For example, this enables PNG and JPEG output with a JPEG quality of 90%::
277277
278- In [1]: set_matplotlib_formats('png', 'jpeg', quality=90)
278+ In [1]: set_matplotlib_formats('png', 'jpeg',
279+ pil_kwargs={'quality': 90})
280+
281+ To set this in your notebook by `%config` magic::
282+
283+ In [1]: %config InlineBackend.figure_formats = {'png', 'jpeg'}
284+ %config InlineBackend.print_figure_kwargs = \\
285+ {'pil_kwargs': {'quality' : 90}}
279286
280287 To set this in your config files use the following::
281288
282289 c.InlineBackend.figure_formats = {'png', 'jpeg'}
283- c.InlineBackend.print_figure_kwargs.update({'quality' : 90})
290+ c.InlineBackend.print_figure_kwargs.update({
291+ 'pil_kwargs': {'quality' : 90}
292+ })
284293
285294 Parameters
286295 ----------
287296 *formats : strs
288297 One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
289298 **kwargs
290299 Keyword args will be relayed to ``figure.canvas.print_figure``.
300+
301+ In addition, see the docstrings of `plt.savefig()`,
302+ `matplotlib.figure.Figure.savefig()`, `PIL.Image.Image.save()` and
303+ :ref:`Pillow Image file formats <handbook/image-file-formats>`.
291304 """
292305 # build kwargs, starting with InlineBackend config
293306 cfg = InlineBackend .instance ()
0 commit comments