19
19
# Matplotlib graphs your data on `~.figure.Figure`\s (i.e., windows, Jupyter
20
20
# widgets, etc.), each of which can contain one or more `~.axes.Axes` (i.e., an
21
21
# area where points can be specified in terms of x-y coordinates (or theta-r
22
- # in a polar plot, or x-y-z in a 3D plot, etc.). The most simple way of
22
+ # in a polar plot, or x-y-z in a 3D plot, etc.). The simplest way of
23
23
# creating a figure with an axes is using `.pyplot.subplots`. We can then use
24
24
# `.Axes.plot` to draw some data on the axes:
25
25
39
39
# In fact, you can do the same in Matplotlib: for each `~.axes.Axes` graphing
40
40
# method, there is a corresponding function in the :mod:`matplotlib.pyplot`
41
41
# module that performs that plot on the "current" axes, creating that axes (and
42
- # its parent figure) if they don't exist yet. So the previous example can be
42
+ # its parent figure) if they don't exist yet. So, the previous example can be
43
43
# written more shortly as
44
44
45
45
plt .plot ([1 , 2 , 3 , 4 ], [1 , 4 , 2 , 3 ]) # Matplotlib plot.
108
108
# :class:`~matplotlib.artist.Artist`
109
109
# ----------------------------------
110
110
#
111
- # Basically everything you can see on the figure is an artist (even the
111
+ # Basically, everything you can see on the figure is an artist (even the
112
112
# `.Figure`, `Axes <.axes.Axes>`, and `~.axis.Axis` objects). This includes
113
113
# `.Text` objects, `.Line2D` objects, :mod:`.collections` objects, `.Patch`
114
114
# objects ... (you get the idea). When the figure is rendered, all of the
175
175
plt .legend ()
176
176
177
177
###############################################################################
178
- # Actually there is a third approach, for the case where you are embedding
178
+ # In addition, there is a third approach, for the case when embedding
179
179
# Matplotlib in a GUI application, which completely drops pyplot, even for
180
180
# figure creation. We won't discuss it here; see the corresponding section in
181
181
# the gallery for more info (:ref:`user_interfaces`).
200
200
# ...
201
201
#
202
202
# for an even more MATLAB-like style. This approach is strongly discouraged
203
- # nowadays and deprecated; it is only mentioned here because you may still
203
+ # nowadays and deprecated. It is only mentioned here because you may still
204
204
# encounter it in the wild.
205
205
#
206
206
# Typically one finds oneself making the same plots over and over
@@ -266,17 +266,17 @@ def my_plotter(ax, data1, data2, param_dict):
266
266
#
267
267
# A lot of documentation on the website and in the mailing lists refers
268
268
# to the "backend" and many new users are confused by this term.
269
- # matplotlib targets many different use cases and output formats. Some
270
- # people use matplotlib interactively from the python shell and have
269
+ # Matplotlib targets many different use cases and output formats. Some
270
+ # people use Matplotlib interactively from the python shell and have
271
271
# plotting windows pop up when they type commands. Some people run
272
272
# `Jupyter <https://jupyter.org>`_ notebooks and draw inline plots for
273
- # quick data analysis. Others embed matplotlib into graphical user
273
+ # quick data analysis. Others embed Matplotlib into graphical user
274
274
# interfaces like wxpython or pygtk to build rich applications. Some
275
- # people use matplotlib in batch scripts to generate postscript images
275
+ # people use Matplotlib in batch scripts to generate postscript images
276
276
# from numerical simulations, and still others run web application
277
277
# servers to dynamically serve up graphs.
278
278
#
279
- # To support all of these use cases, matplotlib can target different
279
+ # To support all of these use cases, Matplotlib can target different
280
280
# outputs, and each of these capabilities is called a backend; the
281
281
# "frontend" is the user facing code, i.e., the plotting code, whereas the
282
282
# "backend" does all the hard work behind-the-scenes to make the figure.
@@ -343,7 +343,7 @@ def my_plotter(ax, data1, data2, param_dict):
343
343
# import matplotlib
344
344
# matplotlib.use('qt5agg')
345
345
#
346
- # This should be done before any figure is created; otherwise Matplotlib may
346
+ # This should be done before any figure is created, otherwise Matplotlib may
347
347
# fail to switch the backend and raise an ImportError.
348
348
#
349
349
# Using `~matplotlib.use` will require changes in your code if users want to
@@ -357,16 +357,16 @@ def my_plotter(ax, data1, data2, param_dict):
357
357
#
358
358
# By default, Matplotlib should automatically select a default backend which
359
359
# allows both interactive work and plotting from scripts, with output to the
360
- # screen and/or to a file, so at least initially you will not need to worry
360
+ # screen and/or to a file, so at least initially, you will not need to worry
361
361
# about the backend. The most common exception is if your Python distribution
362
- # comes without :mod:`tkinter` and you have no other GUI toolkit installed;
363
- # this happens on certain Linux distributions, where you need to install a
362
+ # comes without :mod:`tkinter` and you have no other GUI toolkit installed.
363
+ # This happens on certain Linux distributions, where you need to install a
364
364
# Linux package named ``python-tk`` (or similar).
365
365
#
366
366
# If, however, you want to write graphical user interfaces, or a web
367
367
# application server (:ref:`howto-webapp`), or need a better
368
368
# understanding of what is going on, read on. To make things a little
369
- # more customizable for graphical user interfaces, matplotlib separates
369
+ # more customizable for graphical user interfaces, Matplotlib separates
370
370
# the concept of the renderer (the thing that actually does the drawing)
371
371
# from the canvas (the place where the drawing goes). The canonical
372
372
# renderer for user interfaces is ``Agg`` which uses the `Anti-Grain
@@ -383,7 +383,7 @@ def my_plotter(ax, data1, data2, param_dict):
383
383
# generate a pixel representation of the line whose accuracy depends on a
384
384
# DPI setting.
385
385
#
386
- # Here is a summary of the matplotlib renderers (there is an eponymous
386
+ # Here is a summary of the Matplotlib renderers (there is an eponymous
387
387
# backend for each; these are *non-interactive backends*, capable of
388
388
# writing to a file):
389
389
#
@@ -484,7 +484,7 @@ def my_plotter(ax, data1, data2, param_dict):
484
484
# ``pyside`` to use ``PyQt4`` or ``PySide``, respectively.
485
485
#
486
486
# Since the default value for the bindings to be used is ``PyQt4``, Matplotlib
487
- # first tries to import it, if the import fails, it tries to import ``PySide``.
487
+ # first tries to import it. If the import fails, it tries to import ``PySide``.
488
488
#
489
489
# Using non-builtin backends
490
490
# --------------------------
@@ -505,20 +505,20 @@ def my_plotter(ax, data1, data2, param_dict):
505
505
# and whether a script or shell session continues after a plot
506
506
# is drawn on the screen, depends on the functions and methods
507
507
# that are called, and on a state variable that determines whether
508
- # matplotlib is in "interactive mode". The default Boolean value is set
508
+ # Matplotlib is in "interactive mode". The default Boolean value is set
509
509
# by the :file:`matplotlibrc` file, and may be customized like any other
510
510
# configuration parameter (see :doc:`/tutorials/introductory/customizing`). It
511
511
# may also be set via :func:`matplotlib.interactive`, and its
512
512
# value may be queried via :func:`matplotlib.is_interactive`. Turning
513
513
# interactive mode on and off in the middle of a stream of plotting
514
514
# commands, whether in a script or in a shell, is rarely needed
515
- # and potentially confusing, so in the following we will assume all
515
+ # and potentially confusing. In the following, we will assume all
516
516
# plotting is done with interactive mode either on or off.
517
517
#
518
518
# .. note::
519
519
# Major changes related to interactivity, and in particular the
520
520
# role and behavior of :func:`~matplotlib.pyplot.show`, were made in the
521
- # transition to matplotlib version 1.0, and bugs were fixed in
521
+ # transition to Matplotlib version 1.0, and bugs were fixed in
522
522
# 1.0.1. Here we describe the version 1.0.1 behavior for the
523
523
# primary interactive backends, with the partial exception of
524
524
# *macosx*.
@@ -558,7 +558,7 @@ def my_plotter(ax, data1, data2, param_dict):
558
558
# ax.plot([3.1, 2.2])
559
559
#
560
560
# If you are using certain backends (like ``macosx``), or an older version
561
- # of matplotlib , you may not see the new line added to the plot immediately.
561
+ # of Matplotlib , you may not see the new line added to the plot immediately.
562
562
# In this case, you need to explicitly call :func:`~matplotlib.pyplot.draw`
563
563
# in order to update the plot::
564
564
#
@@ -610,7 +610,7 @@ def my_plotter(ax, data1, data2, param_dict):
610
610
# plt.plot(np.random.rand(10))
611
611
# plt.show()
612
612
#
613
- # which makes three plots, one at a time. I.e. the second plot will show up,
613
+ # This makes three plots, one at a time. I.e., the second plot will show up
614
614
# once the first plot is closed.
615
615
#
616
616
# Summary
@@ -714,7 +714,7 @@ def my_plotter(ax, data1, data2, param_dict):
714
714
#
715
715
# plt.plot(x, y, markevery=10)
716
716
#
717
- # The markevery argument allows for naive subsampling, or an
717
+ # The `` markevery`` argument allows for naive subsampling, or an
718
718
# attempt at evenly spaced (along the *x* axis) sampling. See the
719
719
# :doc:`/gallery/lines_bars_and_markers/markevery_demo`
720
720
# for more information.
@@ -776,7 +776,7 @@ def my_plotter(ax, data1, data2, param_dict):
776
776
# import matplotlib.style as mplstyle
777
777
# mplstyle.use('fast')
778
778
#
779
- # It is very light weight , so it plays nicely with other
779
+ # It is very lightweight , so it plays nicely with other
780
780
# styles, just make sure the fast style is applied last
781
781
# so that other styles do not overwrite the settings::
782
782
#
0 commit comments