|
23 | 23 |
|
24 | 24 | .. _screenshots_subplot_demo:
|
25 | 25 |
|
26 |
| -Subplot demo |
27 |
| -============ |
| 26 | +Multiple subplots in one figure |
| 27 | +=============================== |
28 | 28 |
|
29 | 29 | Multiple axes (i.e. subplots) are created with the
|
30 |
| -:func:`~matplotlib.pyplot.subplot` command: |
| 30 | +:func:`~matplotlib.pyplot.subplot` function: |
31 | 31 |
|
32 | 32 | .. figure:: ../../gallery/subplots_axes_and_figures/images/sphx_glr_subplot_001.png
|
33 | 33 | :target: ../../gallery/subplots_axes_and_figures/subplot.html
|
|
36 | 36 |
|
37 | 37 | Subplot
|
38 | 38 |
|
| 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 | +
|
39 | 73 | .. _screenshots_histogram_demo:
|
40 | 74 |
|
41 | 75 | Histograms
|
42 | 76 | ==========
|
43 | 77 |
|
44 |
| -The :func:`~matplotlib.pyplot.hist` command automatically generates |
| 78 | +The :func:`~matplotlib.pyplot.hist` function automatically generates |
45 | 79 | histograms and returns the bin counts or probabilities:
|
46 | 80 |
|
47 | 81 | .. figure:: ../../gallery/statistics/images/sphx_glr_histogram_features_001.png
|
|
54 | 88 |
|
55 | 89 | .. _screenshots_path_demo:
|
56 | 90 |
|
57 |
| -Path demo |
58 |
| -========= |
| 91 | +Paths |
| 92 | +===== |
59 | 93 |
|
60 | 94 | You can add arbitrary paths in Matplotlib using the
|
61 | 95 | :mod:`matplotlib.path` module:
|
|
69 | 103 |
|
70 | 104 | .. _screenshots_mplot3d_surface:
|
71 | 105 |
|
72 |
| -mplot3d |
73 |
| -========= |
| 106 | +Three-dimensional plotting |
| 107 | +========================== |
74 | 108 |
|
75 | 109 | The mplot3d toolkit (see :ref:`toolkit_mplot3d-tutorial` and
|
76 | 110 | :ref:`mplot3d-examples-index`) has support for simple 3d graphs
|
|
103 | 137 | :align: center
|
104 | 138 | :scale: 50
|
105 | 139 |
|
106 |
| - Plot Streamplot |
| 140 | + Streamplot with various plotting options. |
107 | 141 |
|
108 | 142 | This feature complements the :meth:`~matplotlib.pyplot.quiver` function for
|
109 | 143 | plotting vector fields. Thanks to Tom Flannaghan and Tony Yu for adding the
|
|
132 | 166 | Bar charts
|
133 | 167 | ==========
|
134 | 168 |
|
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 |
136 | 170 | includes customizations such as error bars:
|
137 | 171 |
|
138 | 172 | .. figure:: ../../gallery/statistics/images/sphx_glr_barchart_demo_001.png
|
|
153 | 187 | Pie charts
|
154 | 188 | ==========
|
155 | 189 |
|
156 |
| -The :func:`~matplotlib.pyplot.pie` command allows you to create pie |
| 190 | +The :func:`~matplotlib.pyplot.pie` function allows you to create pie |
157 | 191 | charts. Optional features include auto-labeling the percentage of area,
|
158 | 192 | exploding one or more wedges from the center of the pie, and a shadow effect.
|
159 | 193 | Take a close look at the attached code, which generates this figure in just
|
|
168 | 202 |
|
169 | 203 | .. _screenshots_table_demo:
|
170 | 204 |
|
171 |
| -Table demo |
172 |
| -========== |
| 205 | +Tables |
| 206 | +====== |
173 | 207 |
|
174 |
| -The :func:`~matplotlib.pyplot.table` command adds a text table |
| 208 | +The :func:`~matplotlib.pyplot.table` function adds a text table |
175 | 209 | to an axes.
|
176 | 210 |
|
177 | 211 | .. figure:: ../../gallery/misc/images/sphx_glr_table_demo_001.png
|
|
185 | 219 | .. _screenshots_scatter_demo:
|
186 | 220 |
|
187 | 221 |
|
188 |
| -Scatter demo |
189 |
| -============ |
| 222 | +Scatter plots |
| 223 | +============= |
190 | 224 |
|
191 |
| -The :func:`~matplotlib.pyplot.scatter` command makes a scatter plot |
| 225 | +The :func:`~matplotlib.pyplot.scatter` function makes a scatter plot |
192 | 226 | with (optional) size and color arguments. This example plots changes
|
193 | 227 | in Google's stock price, with marker sizes reflecting the
|
194 | 228 | trading volume and colors varying with time. Here, the
|
|
204 | 238 |
|
205 | 239 | .. _screenshots_slider_demo:
|
206 | 240 |
|
207 |
| -Slider demo |
| 241 | +GUI widgets |
208 | 242 | ===========
|
209 | 243 |
|
210 | 244 | Matplotlib has basic GUI widgets that are independent of the graphical
|
|
217 | 251 | :align: center
|
218 | 252 | :scale: 50
|
219 | 253 |
|
220 |
| - Slider Demo |
| 254 | + Slider and radio-button GUI. |
221 | 255 |
|
222 | 256 |
|
223 | 257 | .. _screenshots_fill_demo:
|
224 | 258 |
|
225 |
| -Fill demo |
226 |
| -========= |
| 259 | +Filled curves |
| 260 | +============= |
227 | 261 |
|
228 |
| -The :func:`~matplotlib.pyplot.fill` command lets you |
| 262 | +The :func:`~matplotlib.pyplot.fill` function lets you |
229 | 263 | plot filled curves and polygons:
|
230 | 264 |
|
231 | 265 | .. figure:: ../../gallery/lines_bars_and_markers/images/sphx_glr_fill_001.png
|
|
239 | 273 |
|
240 | 274 | .. _screenshots_date_demo:
|
241 | 275 |
|
242 |
| -Date demo |
243 |
| -========= |
| 276 | +Date handling |
| 277 | +============= |
244 | 278 |
|
245 | 279 | You can plot timeseries data with major and minor ticks and custom
|
246 | 280 | tick formatters for both.
|
|
280 | 314 | Polar plots
|
281 | 315 | ===========
|
282 | 316 |
|
283 |
| -The :func:`~matplotlib.pyplot.polar` command generates polar plots. |
| 317 | +The :func:`~matplotlib.pyplot.polar` function generates polar plots. |
284 | 318 |
|
285 | 319 | .. figure:: ../../gallery/pie_and_polar_charts/images/sphx_glr_polar_demo_001.png
|
286 | 320 | :target: ../../gallery/pie_and_polar_charts/polar_demo.html
|
|
295 | 329 | Legends
|
296 | 330 | =======
|
297 | 331 |
|
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. |
301 | 335 |
|
302 | 336 | .. figure:: ../../gallery/api/images/sphx_glr_legend_001.png
|
303 | 337 | :target: ../../gallery/api/legend.html
|
|
306 | 340 |
|
307 | 341 | Legend
|
308 | 342 |
|
309 |
| -Thanks to Charles Twardy for input on the legend command. |
| 343 | +Thanks to Charles Twardy for input on the legend function. |
310 | 344 |
|
311 | 345 | .. _screenshots_mathtext_examples_demo:
|
312 | 346 |
|
313 |
| -Mathtext_examples |
314 |
| -================= |
| 347 | +TeX-notation for text objects |
| 348 | +============================= |
315 | 349 |
|
316 | 350 | Below is a sampling of the many TeX expressions now supported by Matplotlib's
|
317 | 351 | internal mathtext engine. The mathtext module provides TeX style mathematical
|
|
349 | 383 |
|
350 | 384 | .. _screenshots_eeg_demo:
|
351 | 385 |
|
352 |
| -EEG demo |
353 |
| -========= |
| 386 | +EEG GUI |
| 387 | +======= |
354 | 388 |
|
355 | 389 | You can embed Matplotlib into pygtk, wx, Tk, or Qt applications.
|
356 | 390 | Here is a screenshot of an EEG viewer called `pbrain
|
|
372 | 406 | XKCD-style sketch plots
|
373 | 407 | =======================
|
374 | 408 |
|
375 |
| -Matplotlib supports plotting in the style of `xkcd |
| 409 | +Just for fun, Matplotlib supports plotting in the style of `xkcd |
376 | 410 | <http://www.xkcd.com/>`.
|
377 | 411 |
|
378 | 412 | .. figure:: ../../gallery/showcase/images/sphx_glr_xkcd_001.png
|
|
383 | 417 | Xkcd
|
384 | 418 | """
|
385 | 419 |
|
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 | +# |
387 | 427 | import matplotlib.pyplot as plt
|
388 | 428 | import numpy as np
|
389 | 429 |
|
|
0 commit comments