8000 More links · matplotlib/matplotlib@3f4f42e · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f4f42e

Browse files
committed
More links
1 parent c8b228f commit 3f4f42e

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

galleries/users_explain/figure/backends.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ Backends
1111
What is a backend?
1212
------------------
1313

14-
A lot of documentation on the website and in the mailing lists refers
15-
to the "backend" and many new users are confused by this term.
16-
Matplotlib targets many different use cases and output formats. Some
17-
people use Matplotlib interactively from the Python shell and have
18-
plotting windows pop up when they type commands. Some people run
19-
`Jupyter <https://jupyter.org>`_ notebooks and draw inline plots for
20-
quick data analysis. Others embed Matplotlib into graphical user
21-
interfaces like PyQt or PyGObject to build rich applications. Some
22-
people use Matplotlib in batch scripts to generate postscript images
23-
from numerical simulations, and still others run web application
24-
servers to dynamically serve up graphs.
14+
Backends are used for out-putting Matplotlib figures (see :ref:`figure-intro`),
15+
to the screen or for writing to files. A lot of
16+
documentation on the website and in the mailing lists refers to the "backend"
17+
and many new users are confused by this term. Matplotlib targets many different
18+
use cases and output formats. Some people use Matplotlib interactively from
19+
the Python shell and have plotting windows pop up when they type commands.
20+
Some people run `Jupyter <https://jupyter.org>`_ notebooks and draw inline
21+
plots for quick data analysis. Others embed Matplotlib into graphical user
22+
interfaces like PyQt or PyGObject to build rich applications. Some people use
23+
Matplotlib in batch scripts to generate postscript images from numerical
24+
simulations, and still others run web application servers to dynamically serve
25+
up graphs.
2526

2627
To support all of these use cases, Matplotlib can target different
2728
outputs, and each of these capabilities is called a backend; the
@@ -256,21 +257,23 @@ Debugging the figure windows not showing
256257

257258
Sometimes things do not work as expected, usually during an install.
258259

259-
If you are using a Notebook or integrated development environment (PyCharm),
260+
If you are using a Notebook or integrated development environment (see :ref:`notebooks-and-ides`),
260261
please consult their documentation for debugging figures not working in their
261262
environments.
262263

263-
If you are using one of Matplotlib's graphics backends, make sure you know which
264+
If you are using one of Matplotlib's graphics backends (see :ref:`standalone-scripts-and-interactive-use`), make sure you know which
264265
one is being used:
265266

266267
.. code-block:: python3
268+
267269
import matplotlib
268270
269271
print(matplotlib.get_backend())
270272
271273
Try a simple plot, as see if the GUI opens:
272274

273275
.. code-block:: python3
276+
274277
import matplotlib
275278
import matplotlib.pyplot as plt
276279
@@ -287,6 +290,7 @@ PyQT
287290
^^^^
288291

289292
.. code-block:: bash
293+
290294
python -c "from PyQt5.QtWidgets import *; app = QApplication([]); win = QMainWindow(); win.show(); app.exec()"
291295
292296
If you have ``PySide`` or ``PyQT6`` installed instead, just change the import
@@ -296,12 +300,14 @@ GTK
296300
^^^
297301

298302
.. code-block:: bash
303+
299304
python3 -c 'from gi.repository import Gtk; win = Gtk.Window(); win.connect("destroy", Gtk.main_quit); win.show(); Gtk.main()'
300305
301306
wxPython
302307
^^^^^^^^
303308

304309
.. code-block:: python3
310+
305311
import wx
306312
307313
app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window.

galleries/users_explain/figure/figure_intro.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.. redirect-from:: /users/explain/figure
33

44
.. _figure_explanation:
5+
.. _figure-intro:
56

67
+++++++++++++++++++++++
78
Introduction to Figures
@@ -36,6 +37,8 @@ We will discuss how to create Figures in more detail below, but first it is
3637
helpful to understand how to view a Figure. This varies based on how you are
3738
using Matplotlib, and what :ref:`Backend <what-is-a-backend>` you are using.
3839

40+
.. _notebooks-and-ides:
41+
3942
Notebooks and IDEs
4043
------------------
4144

@@ -73,6 +76,8 @@ other than the default "inline" backend, you will likely need to use an ipython
7376
.. seealso::
7477
:ref:`interactive_figures`.
7578

79+
.. _standalone-scripts-and-interactive-use:
80+
7681
Standalone scripts and interactive use
7782
--------------------------------------
7883

0 commit comments

Comments
 (0)
0