From 329cf64882318c12d9e053c69420e9ff33df3dd3 2023-02-05 14:33:57 From: Antony Lee Date: 2023-02-05 14:33:57 Subject: [PATCH] Adjust %matplotlib docstring re: matplotlib_inline. set_matplotlib_formats and set_matplotlib_close have been deprecated in IPython.display and moved out to matplotlib_inline.backend_inline; adjust the docstring of the %matplotlib magic accordingly. --- diff --git a/IPython/core/magics/pylab.py b/IPython/core/magics/pylab.py index 0f3fff6..2a69453 100644 --- a/IPython/core/magics/pylab.py +++ b/IPython/core/magics/pylab.py @@ -54,7 +54,7 @@ class PylabMagics(Magics): If you are using the inline matplotlib backend in the IPython Notebook you can set which figure formats are enabled using the following:: - In [1]: from IPython.display import set_matplotlib_formats + In [1]: from matplotlib_inline.backend_inline import set_matplotlib_formats In [2]: set_matplotlib_formats('pdf', 'svg') @@ -65,9 +65,9 @@ class PylabMagics(Magics): In [3]: %config InlineBackend.print_figure_kwargs = {'bbox_inches':None} - In addition, see the docstring of - `IPython.display.set_matplotlib_formats` and - `IPython.display.set_matplotlib_close` for more information on + In addition, see the docstrings of + `matplotlib_inline.backend_inline.set_matplotlib_formats` and + `matplotlib_inline.backend_inline.set_matplotlib_close` for more information on changing additional behaviors of the inline backend. Examples