Skip to content

Commit d00a72e

Browse files
committed
DOC: Remove notebook instructions from image tutorial
This information is not needed for the tutorial. For a topic tutorial, we can assume that the user has a working matplotlib setup one way or the other and basically knows how to operate it. The notebook instructions are also not that specific or valuable that it would be worth extracting to another place. Closes matplotlib#20554.
1 parent efc43d1 commit d00a72e

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

galleries/tutorials/images.py

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,6 @@
77
Image tutorial
88
==============
99
10-
A short tutorial on plotting images with Matplotlib.
11-
12-
.. _imaging_startup:
13-
14-
Startup commands
15-
===================
16-
17-
First, let's start IPython. It is a most excellent enhancement to the
18-
standard Python prompt, and it ties in especially well with
19-
Matplotlib. Start IPython either directly at a shell, or with the Jupyter
20-
Notebook (where IPython as a running kernel).
21-
22-
With IPython started, we now need to connect to a GUI event loop. This
23-
tells IPython where (and how) to display plots. To connect to a GUI
24-
loop, execute the **%matplotlib** magic at your IPython prompt. There's more
25-
detail on exactly what this does at `IPython's documentation on GUI
26-
event loops
27-
<https://ipython.readthedocs.io/en/stable/interactive/reference.html#gui-event-loop-support>`_.
28-
29-
If you're using Jupyter Notebook, the same commands are available, but
30-
people commonly use a specific argument to the %matplotlib magic:
31-
32-
.. sourcecode:: ipython
33-
34-
In [1]: %matplotlib inline
35-
36-
This turns on inline plotting, where plot graphics will appear in your notebook. This
37-
has important implications for interactivity. For inline plotting, commands in
38-
cells below the cell that outputs a plot will not affect the plot. For example,
39-
changing the colormap is not possible from cells below the cell that creates a plot.
40-
However, for other backends, such as Qt, that open a separate window,
41-
cells below those that create the plot will change the plot - it is a
42-
live object in memory.
43-
4410
This tutorial will use Matplotlib's implicit plotting interface, pyplot. This
4511
interface maintains global state, and is very useful for quickly and easily
4612
experimenting with various plot settings. The alternative is the explicit,
@@ -147,15 +113,6 @@
147113

148114
# %%
149115
#
150-
# .. note::
151-
#
152-
# However, remember that in the Jupyter Notebook with the inline backend,
153-
# you can't make changes to plots that have already been rendered. If you
154-
# create imgplot here in one cell, you cannot call set_cmap() on it in a later
155-
# cell and expect the earlier plot to change. Make sure that you enter these
156-
# commands together in one cell. plt commands will not change plots from earlier
157-
# cells.
158-
#
159116
# There are many other colormap schemes available. See the :ref:`list and images
160117
# of the colormaps<colormaps>`.
161118
#
@@ -201,9 +158,7 @@
201158
# %%
202159
# This can also be done by calling the
203160
# :meth:`~matplotlib.cm.ScalarMappable.set_clim` method of the returned image
204-
# plot object, but make sure that you do so in the same cell as your plot
205-
# command when working with the Jupyter Notebook - it will not change
206-
# plots from earlier cells.
161+
# plot object.
207162

208163
imgplot = plt.imshow(lum_img)
209164
imgplot.set_clim(0, 175)

0 commit comments

Comments
 (0)