@@ -27,27 +27,22 @@ themselves can have multiple Artists added to them
27
27
Viewing Figures
28
28
================
29
29
30
- .. figure :: /_static/FigureTypes.png
31
- :alt: Image of figure generated in jupyter notebook with inline backend,
32
- notebook backend, and qt5Agg backend.
33
-
34
- Screenshot of three figures generated with commonly chosen backends; the
35
- left-hand figure is generated in `Jupyter <https://jupyter.org >`_, with the
36
- default `inline <https://github.com/ipython/matplotlib-inline >`_ backend.
37
- The middle figure is also generated in Jupyter using the notebook backend -
38
- users should also try the `widget <https://matplotlib.org/ipympl/ >`_
39
- backend if using `JupyterLab
40
- <https://jupyterlab.readthedocs.io/en/stable/> `_. The right-hand figure is
41
- created using a script that defaults to the Qt5Agg backend to display the
42
- figure as a new window.
43
-
44
30
We will discuss how to create Figures in more detail below, but first it is
45
31
helpful to understand how to view a Figure. This varies based on how you are
46
32
using Matplotlib, and what :ref: `Backend <what-is-a-backend >` you are using.
47
33
48
34
Notebooks and IDEs
49
35
------------------
50
36
37
+ .. figure :: /_static/FigureInline.png
38
+ :alt: Image of figure generated in jupyter notebook with inline backend.
39
+ :width: 400
40
+
41
+ Screenshot of a `Jupyter notebook <https://jupyter.org >`_, with a figure
42
+ generated via the default `inline
43
+ <https://github.com/ipython/matplotlib-inline> `_ backend.
44
+
45
+
51
46
If you are using a Notebook (e.g. `Jupyter <https://jupyter.org >`_) or an IDE
52
47
that renders Notebooks (PyCharm, VSCode, etc), then they have a backend that
53
48
will render the Matplotlib Figure when a code cell is executed. One thing to
@@ -59,10 +54,19 @@ non-default backends you will likely need to use an ipython "magic" like
59
54
:ref: `notebook <jupyter_notebooks_jupyterlab >` or ``%matplotlib widget `` for
60
55
the `ipympl <https://matplotlib.org/ipympl/ >`_ backend.
61
56
57
+ .. figure :: /_static/FigureNotebook.png
58
+ :alt: Image of figure generated in jupyter notebook with notebook backend.
59
+ :width: 400
60
+
61
+ Screenshot of a Jupyter notebook with an interactive figure generated via
62
+ the notebook backend. Users should also try the similar `widget
63
+ <https://matplotlib.org/ipympl/> `_ backend if using `JupyterLab
64
+ <https://jupyterlab.readthedocs.io/en/stable/> `_.
65
+
66
+
62
67
.. seealso ::
63
68
:ref: `interactive_figures `.
64
69
65
-
66
70
Standalone scripts and interactive use
67
71
--------------------------------------
68
72
@@ -73,6 +77,13 @@ MacOS backend as well. These are typically chosen either in the user's
73
77
:ref: `matplotlibrc <customizing-with-matplotlibrc-files >`, or by calling
74
78
``matplotlib.use('QtAgg') `` at the beginning of a session or script.
75
79
80
+ .. figure :: /_static/FigureQtAgg.png
81
+ :alt: Image of figure generated from a script via the QtAgg backend.
82
+ :width: 370
83
+
84
+ Screenshot of a Figure generated via a python script and shown using the
85
+ QtAgg backend.
86
+
76
87
When run from a script, or interactively (e.g. from an
77
88
`iPython shell <https://https://ipython.readthedocs.io/en/stable/ >`_) the Figure
78
89
will not be shown until we call ``plt.show() ``. The Figure will appear in
0 commit comments