@@ -52,14 +52,20 @@ Notebooks and IDEs
52
52
53
53
If you are using a Notebook (e.g. `Jupyter <https://jupyter.org >`_) or an IDE
54
54
that renders Notebooks (PyCharm, VSCode, etc), then they have a backend that
55
- will render the Matplotlib Figure when a code cell is executed. One thing to
56
- be aware of is that the default Jupyter backend (``%matplotlib inline ``) will
55
+ will render the Matplotlib Figure when a code cell is executed. The default
56
+ Jupyter backend (``%matplotlib inline ``) creates static plots that
57
57
by default trim or expand the figure size to have a tight box around Artists
58
- added to the Figure (see :ref: `saving_figures `, below). If you use a backend
59
- other than the default "inline" backend, you will likely need to use an ipython
60
- "magic" like ``%matplotlib notebook `` for the Matplotlib :ref: `notebook
61
- <jupyter_notebooks_jupyterlab>` or ``%matplotlib widget `` for the `ipympl
62
- <https://matplotlib.org/ipympl/> `_ backend.
58
+ added to the Figure (see :ref: `saving_figures `, below). For interactive plots
59
+ in Jupyter you will need to use an ipython "magic" like ``%matplotlib widget ``
60
+ for the `ipympl <https://matplotlib.org/ipympl/ >`_ backend in ``jupyter lab ``
61
+ or ``notebook>=7 ``, or ``%matplotlib notebook `` for the Matplotlib
62
+ :ref: `notebook <jupyter_notebooks_jupyterlab >` in ``notebook<7 `` or
63
+ ``nbclassic ``.
64
+
65
+ .. note ::
66
+
67
+ The `ipympl <https://matplotlib.org/ipympl/ >`_ backend is in a separate
68
+ package, see :ref: `Installing ipympl <ipympl_install >`.
63
69
64
70
.. figure :: /_static/FigureNotebook.png
65
71
:alt: Image of figure generated in Jupyter Notebook with notebook
@@ -75,15 +81,6 @@ other than the default "inline" backend, you will likely need to use an ipython
75
81
.. seealso ::
76
82
:ref: `interactive_figures `.
77
83
78
- .. note ::
79
-
80
- If you only need to use the classic notebook (i.e. ``notebook<7 ``),
81
- you can use:
82
-
83
- .. sourcecode :: ipython
84
-
85
- %matplotlib notebook
86
-
87
84
.. _standalone-scripts-and-interactive-use :
88
85
89
86
Standalone scripts and interactive use
@@ -104,7 +101,7 @@ backend. These are typically chosen either in the user's :ref:`matplotlibrc
104
101
QtAgg backend.
105
102
106
103
When run from a script, or interactively (e.g. from an
107
- `iPython shell <https://ipython.readthedocs.io/en/stable/ >`_) the Figure
104
+ `IPython shell <https://ipython.readthedocs.io/en/stable/ >`_) the Figure
108
105
will not be shown until we call ``plt.show() ``. The Figure will appear in
109
106
a new GUI window, and usually will have a toolbar with Zoom, Pan, and other tools
110
107
for interacting with the Figure. By default, ``plt.show() `` blocks
0 commit comments