|
39 | 39 | # +------------------------------------+------------------------------------+
|
40 | 40 | # | Useful for repeated code use, | Helpful for quickly graphing data |
|
41 | 41 | # | generalization, robust | when using interactive |
|
42 |
| -# | configurations of graphs. | environments. | |
| 42 | +# | configurations of visuals. | environments. | |
43 | 43 | # +------------------------------------+------------------------------------+
|
44 | 44 | # | Recommended to new users for | Most useful for users coming from |
|
45 | 45 | # | learning fundamentals. | MATLAB. Users already familiar with|
|
|
77 | 77 | # +====================================+====================================+
|
78 | 78 | # | :: | :: |
|
79 | 79 | # | | |
|
80 |
| -# | fig, ax = plt.subplots() | plt.plot([1,2,3],[1,2,3]) | |
81 |
| -# | ax.plot([1,2,3],[1,2,3]) | | |
| 80 | +# | fig, ax = plt.subplots() | plt.plot([1, 2, 3],[1, 2, 3]) | |
| 81 | +# | ax.plot([1, 2, 3],[1, 2, 3]) | | |
82 | 82 | # | | |
|
83 | 83 | # +------------------------------------+------------------------------------+
|
84 | 84 | # | `.pyplot.subplots` generates a | :mod:`matplotlib.pyplot` creates |
|
|
87 | 87 | # | `.Axes.plot` plots the data. | elements and `.pyplot.plot` plots |
|
88 | 88 | # | | the data. |
|
89 | 89 | # +------------------------------------+------------------------------------+
|
90 |
| -# |
91 |
| -# .. image:: ../../_static/getting_started_example.png |
| 90 | +# | .. plot:: | .. plot:: | |
| 91 | +# | | | |
| 92 | +# | fig, ax = plt.subplots() | plt.plot([1,2,3],[1,2,3]) | |
| 93 | +# | ax.plot([1, 2, 3],[1, 2, 3]) | | |
| 94 | +# | | | |
| 95 | +# +------------------------------------+------------------------------------+ |
92 | 96 | #
|
93 | 97 | # .. note::
|
94 | 98 | #
|
95 |
| -# The example image is identical for both explicit and implicit code. |
| 99 | +# The example graphs are identical for both explicit and implicit code. |
96 | 100 | #
|
97 | 101 | # Requirements
|
98 | 102 | # ============
|
|
264 | 268 |
|
265 | 269 | ##############################################################################
|
266 | 270 | #
|
267 |
| -# The module for the OOP example unpacks the Figure and Axes using a single |
268 |
| -# instance of ``pyplot``. This convention uses ``plt.subplots()`` and defaults |
269 |
| -# to one Figure, ``fig``, and one Axes, ``ax``. The `Configuration`_ section |
270 |
| -# below contains additional information about manipulating visuals, multiple |
271 |
| -# visulizations, and other modifications. |
| 271 | +# The module ``pyplot`` for the OOP example unpacks the Figure and Axes. |
| 272 | +# This convention uses ``plt.subplots()`` and defaults to one Figure, ``fig``, |
| 273 | +# and one Axes, ``ax``. The variable names are common shorthand terms. Any |
| 274 | +# naming conventions also work. |
| 275 | +# |
| 276 | +# The `Configuration`_ section below contains additional information about |
| 277 | +# manipulating visuals, multiple visualizations, and other modifications. |
272 | 278 | #
|
273 | 279 | # Using explicit programming allows for ``fig`` and ``ax`` to use separate
|
274 |
| -# methods to manipulate the visualization. Specific Figures and Axes refer to |
275 |
| -# methods in OOP conventions for managing respective data. |
| 280 | +# methods to manipulate the visualization. Specific Figures and Axes manage |
| 281 | +# data components with their own respective methods. |
| 282 | +# |
276 | 283 | #
|
277 | 284 | # Implicit: ``pyplot``
|
278 | 285 | # --------------------
|
|
327 | 334 | #
|
328 | 335 | # The image below depicts each visible element of a Matplotlib graph. The
|
329 | 336 | # graphic uses Matplotlib to display and highlight each individual part of the
|
330 |
| -# visualization. To view the programming for the image, the source code is |
331 |
| -# available at :ref:`sphx_glr_gallery_showcase_anatomy.py`. |
| 337 | +# visualization. To view source code for the image, see |
| 338 | +# :ref:`sphx_glr_gallery_showcase_anatomy.py`. |
332 | 339 | #
|
333 | 340 | #
|
334 | 341 | # .. image:: ../../_static/anatomy.png
|
|
369 | 376 | # contain multiple types of visualizations of data on a single Axes. Each of
|
370 | 377 | # these types are specific to the Axes they are in.
|
371 | 378 | #
|
372 |
| -# Matplotlib Axes also intergrate with other Python libraries. In Axes-based |
| 379 | +# Matplotlib Axes also integrate with other Python libraries. In Axes-based |
373 | 380 | # interfaces, other libraries take an Axes object as input. Libraries such as
|
374 | 381 | # `pandas` and `Seaborn <https://seaborn.pydata.org>`_ act on specific Axes.
|
375 | 382 | #
|
|
378 | 385 | #
|
379 | 386 | # :class:`~matplotlib.artist.Artist`
|
380 | 387 | #
|
381 |
| -# Artists are broad Matplotlib objects that display visuals. These are the |
382 |
| -# visible elements when the Figure is rendered. They correspond to a specific |
383 |
| -# Axes and cannot be shared or transferred. In Matplotlib programming, all |
384 |
| -# objects for display are Artists. |
| 388 | +# Artists are a broad variety of Matplotlib objects. They display visuals and |
| 389 | +# are the visible elements when the Figure is rendered. They correspond to a |
| 390 | +# specific Axes and cannot be shared or transferred. In Matplotlib programming, |
| 391 | +# all objects for display are Artists. |
385 | 392 | #
|
386 | 393 | # .. note::
|
387 | 394 | #
|
|
511 | 518 | def autopct_format(percent, group):
|
512 | 519 | """
|
513 | 520 | Takes percent equivalent and calculates original value from data.
|
514 |
| - Returns fstring of value new line above percentage. |
| 521 | + Returns string of value new line above percentage. |
515 | 522 |
|
516 | 523 | Parameters
|
517 | 524 | ----------
|
|
0 commit comments