Skip to content

Commit b7b7ad1

Browse files
authored
Merge pull request #9394 from jklymak/addpcolor3
[Doc] Add pcolor, contour, imshow to and other small changes
2 parents 8b85dfb + 0cf3a2b commit b7b7ad1

File tree

1 file changed

+75
-35
lines changed

1 file changed

+75
-35
lines changed

tutorials/introductory/sample_plots.py

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
2424
.. _screenshots_subplot_demo:
2525
26-
Subplot demo
27-
============
26+
Multiple subplots in one figure
27+
===============================
2828
2929
Multiple axes (i.e. subplots) are created with the
30-
:func:`~matplotlib.pyplot.subplot` command:
30+
:func:`~matplotlib.pyplot.subplot` function:
3131
3232
.. figure:: ../../gallery/subplots_axes_and_figures/images/sphx_glr_subplot_001.png
3333
:target: ../../gallery/subplots_axes_and_figures/subplot.html
@@ -36,12 +36,46 @@
3636
3737
Subplot
3838
39+
.. _screenshots_images_demo:
40+
41+
Images
42+
======
43+
44+
Matplotlib can display images (assuming equally spaced
45+
horizontal dimensions) using the :func:`~matplotlib.pyplot.imshow` function.
46+
47+
.. figure:: ../../gallery/images_contours_and_fields/images/sphx_glr_image_demo_003.png
48+
:target: ../../gallery/images_contours_and_fields/image_demo.html
49+
:align: center
50+
:scale: 50
51+
52+
Example of using :func:`~matplotlib.pyplot.imshow` to display a CT scan
53+
54+
.. _screenshots_pcolormesh_demo:
55+
56+
57+
Contouring and pseudocolor
58+
==========================
59+
60+
The :func:`~matplotlib.pyplot.pcolormesh` function can make a colored
61+
representation of a two-dimensional array, even if the horizontal dimensions
62+
are unevenly spaced. The
63+
:func:`~matplotlib.pyplot.contour` function is another way to represent
64+
the same data:
65+
66+
.. figure:: ../../gallery/images_contours_and_fields/images/sphx_glr_pcolormesh_levels_001.png
67+
:target: ../../gallery/images_contours_and_fields/pcolormesh_levels.html
68+
:align: center
69+
:scale: 50
70+
71+
Example comparing :func:`~matplotlib.pyplot.pcolormesh` and :func:`~matplotlib.pyplot.contour` for plotting two-dimensional data
72+
3973
.. _screenshots_histogram_demo:
4074
4175
Histograms
4276
==========
4377
44-
The :func:`~matplotlib.pyplot.hist` command automatically generates
78+
The :func:`~matplotlib.pyplot.hist` function automatically generates
4579
histograms and returns the bin counts or probabilities:
4680
4781
.. figure:: ../../gallery/statistics/images/sphx_glr_histogram_features_001.png
@@ -54,8 +88,8 @@
5488
5589
.. _screenshots_path_demo:
5690
57-
Path demo
58-
=========
91+
Paths
92+
=====
5993
6094
You can add arbitrary paths in Matplotlib using the
6195
:mod:`matplotlib.path` module:
@@ -69,8 +103,8 @@
69103
70104
.. _screenshots_mplot3d_surface:
71105
72-
mplot3d
73-
=========
106+
Three-dimensional plotting
107+
==========================
74108
75109
The mplot3d toolkit (see :ref:`toolkit_mplot3d-tutorial` and
76110
:ref:`mplot3d-examples-index`) has support for simple 3d graphs
@@ -103,7 +137,7 @@
103137
:align: center
104138
:scale: 50
105139
106-
Plot Streamplot
140+
Streamplot with various plotting options.
107141
108142
This feature complements the :meth:`~matplotlib.pyplot.quiver` function for
109143
plotting vector fields. Thanks to Tom Flannaghan and Tony Yu for adding the
@@ -132,7 +166,7 @@
132166
Bar charts
133167
==========
134168
135-
Use the :func:`~matplotlib.pyplot.bar` command to make bar charts, which
169+
Use the :func:`~matplotlib.pyplot.bar` function to make bar charts, which
136170
includes customizations such as error bars:
137171
138172
.. figure:: ../../gallery/statistics/images/sphx_glr_barchart_demo_001.png
@@ -153,7 +187,7 @@
153187
Pie charts
154188
==========
155189
156-
The :func:`~matplotlib.pyplot.pie` command allows you to create pie
190+
The :func:`~matplotlib.pyplot.pie` function allows you to create pie
157191
charts. Optional features include auto-labeling the percentage of area,
158192
exploding one or more wedges from the center of the pie, and a shadow effect.
159193
Take a close look at the attached code, which generates this figure in just
@@ -168,10 +202,10 @@
168202
169203
.. _screenshots_table_demo:
170204
171-
Table demo
172-
==========
205+
Tables
206+
======
173207
174-
The :func:`~matplotlib.pyplot.table` command adds a text table
208+
The :func:`~matplotlib.pyplot.table` function adds a text table
175209
to an axes.
176210
177211
.. figure:: ../../gallery/misc/images/sphx_glr_table_demo_001.png
@@ -185,10 +219,10 @@
185219
.. _screenshots_scatter_demo:
186220
187221
188-
Scatter demo
189-
============
222+
Scatter plots
223+
=============
190224
191-
The :func:`~matplotlib.pyplot.scatter` command makes a scatter plot
225+
The :func:`~matplotlib.pyplot.scatter` function makes a scatter plot
192226
with (optional) size and color arguments. This example plots changes
193227
in Google's stock price, with marker sizes reflecting the
194228
trading volume and colors varying with time. Here, the
@@ -204,7 +238,7 @@
204238
205239
.. _screenshots_slider_demo:
206240
207-
Slider demo
241+
GUI widgets
208242
===========
209243
210244
Matplotlib has basic GUI widgets that are independent of the graphical
@@ -217,15 +251,15 @@
217251
:align: center
218252
:scale: 50
219253
220-
Slider Demo
254+
Slider and radio-button GUI.
221255
222256
223257
.. _screenshots_fill_demo:
224258
225-
Fill demo
226-
=========
259+
Filled curves
260+
=============
227261
228-
The :func:`~matplotlib.pyplot.fill` command lets you
262+
The :func:`~matplotlib.pyplot.fill` function lets you
229263
plot filled curves and polygons:
230264
231265
.. figure:: ../../gallery/lines_bars_and_markers/images/sphx_glr_fill_001.png
@@ -239,8 +273,8 @@
239273
240274
.. _screenshots_date_demo:
241275
242-
Date demo
243-
=========
276+
Date handling
277+
=============
244278
245279
You can plot timeseries data with major and minor ticks and custom
246280
tick formatters for both.
@@ -280,7 +314,7 @@
280314
Polar plots
281315
===========
282316
283-
The :func:`~matplotlib.pyplot.polar` command generates polar plots.
317+
The :func:`~matplotlib.pyplot.polar` function generates polar plots.
284318
285319
.. figure:: ../../gallery/pie_and_polar_charts/images/sphx_glr_polar_demo_001.png
286320
:target: ../../gallery/pie_and_polar_charts/polar_demo.html
@@ -295,9 +329,9 @@
295329
Legends
296330
=======
297331
298-
The :func:`~matplotlib.pyplot.legend` command automatically
299-
generates figure legends, with MATLAB-compatible legend placement
300-
commands.
332+
The :func:`~matplotlib.pyplot.legend` function automatically
333+
generates figure legends, with MATLAB-compatible legend-placement
334+
functions.
301335
302336
.. figure:: ../../gallery/api/images/sphx_glr_legend_001.png
303337
:target: ../../gallery/api/legend.html
@@ -306,12 +340,12 @@
306340
307341
Legend
308342
309-
Thanks to Charles Twardy for input on the legend command.
343+
Thanks to Charles Twardy for input on the legend function.
310344
311345
.. _screenshots_mathtext_examples_demo:
312346
313-
Mathtext_examples
314-
=================
347+
TeX-notation for text objects
348+
=============================
315349
316350
Below is a sampling of the many TeX expressions now supported by Matplotlib's
317351
internal mathtext engine. The mathtext module provides TeX style mathematical
@@ -349,8 +383,8 @@
349383
350384
.. _screenshots_eeg_demo:
351385
352-
EEG demo
353-
=========
386+
EEG GUI
387+
=======
354388
355389
You can embed Matplotlib into pygtk, wx, Tk, or Qt applications.
356390
Here is a screenshot of an EEG viewer called `pbrain
@@ -372,7 +406,7 @@
372406
XKCD-style sketch plots
373407
=======================
374408
375-
Matplotlib supports plotting in the style of `xkcd
409+
Just for fun, Matplotlib supports plotting in the style of `xkcd
376410
<http://www.xkcd.com/>`.
377411
378412
.. figure:: ../../gallery/showcase/images/sphx_glr_xkcd_001.png
@@ -383,7 +417,13 @@
383417
Xkcd
384418
"""
385419

386-
# An extra set of sample plots for the thumbnail image.
420+
###################################################################
421+
# Subplot example
422+
# ===============
423+
#
424+
# Many plot types can be combined in one figure to create
425+
# powerful and flexible representations of data.
426+
#
387427
import matplotlib.pyplot as plt
388428
import numpy as np
389429

0 commit comments

Comments
 (0)