Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 951d148

Browse files
committed
DOC: break apart figure [skip azp] [skip actions] [skip appveyor]
1 parent a95d051 commit 951d148

File tree

4 files changed

+26
-15
lines changed

4 files changed

+26
-15
lines changed

doc/_static/FigureInline.png

425 KB
Loading

doc/_static/FigureNotebook.png

429 KB
Loading

doc/_static/FigureQtAgg.png

862 KB
Loading

doc/users/explain/figures.rst

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,22 @@ themselves can have multiple Artists added to them
2727
Viewing Figures
2828
================
2929

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-
4430
We will discuss how to create Figures in more detail below, but first it is
4531
helpful to understand how to view a Figure. This varies based on how you are
4632
using Matplotlib, and what :ref:`Backend <what-is-a-backend>` you are using.
4733

4834
Notebooks and IDEs
4935
------------------
5036

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+
5146
If you are using a Notebook (e.g. `Jupyter <https://jupyter.org>`_) or an IDE
5247
that renders Notebooks (PyCharm, VSCode, etc), then they have a backend that
5348
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
5954
:ref:`notebook <jupyter_notebooks_jupyterlab>` or ``%matplotlib widget`` for
6055
the `ipympl <https://matplotlib.org/ipympl/>`_ backend.
6156

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+
6267
.. seealso::
6368
:ref:`interactive_figures`.
6469

65-
6670
Standalone scripts and interactive use
6771
--------------------------------------
6872

@@ -73,6 +77,13 @@ MacOS backend as well. These are typically chosen either in the user's
7377
:ref:`matplotlibrc <customizing-with-matplotlibrc-files>`, or by calling
7478
``matplotlib.use('QtAgg')`` at the beginning of a session or script.
7579

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+
7687
When run from a script, or interactively (e.g. from an
7788
`iPython shell <https://https://ipython.readthedocs.io/en/stable/>`_) the Figure
7889
will not be shown until we call ``plt.show()``. The Figure will appear in

0 commit comments

Comments
 (0)