Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1d3c6a

Browse files
committed
Some minor textual cleanup to the pyplot tutorial.
1 parent 1b4e122 commit f1d3c6a

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

doc/users/pyplot_tutorial.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ Pyplot tutorial
77
:mod:`matplotlib.pyplot` is a collection of command style functions
88
that make matplotlib work like MATLAB.
99
Each ``pyplot`` function makes
10-
some change to a figure: e.g., create a figure, create a plotting area
11-
in a figure, plot some lines in a plotting area, decorate the plot
12-
with labels, etc.... :mod:`matplotlib.pyplot` is stateful, in that it
13-
keeps track of the current figure and plotting area, and the plotting
10+
some change to a figure: e.g., creates a figure, creates a plotting area
11+
in a figure, plots some lines in a plotting area, decorates the plot
12+
with labels, etc. In :mod:`matplotlib.pyplot` various states are preserved
13+
across function calls, so that it keeps track of
14+
the current figure and plotting area, and the plotting
1415
functions are directed to the current axes (please note that "axes" here
1516
and in most places in the documentation refers to the *axes*
1617
`part of a figure <http://matplotlib.org/faq/usage_faq.html#parts-of-a-figure>`__
@@ -73,10 +74,11 @@ several ways to set line properties
7374
plt.plot(x, y, linewidth=2.0)
7475

7576

76-
* Use the setter methods of the ``Line2D`` instance. ``plot`` returns a list
77-
of lines; e.g., ``line1, line2 = plot(x1,y1,x2,y2)``. Below I have only
78-
one line so it is a list of length 1. I use tuple unpacking in the
79-
``line, = plot(x, y, 'o')`` to get the first element of the list::
77+
* Use the setter methods of a ``Line2D`` instance. ``plot`` returns a list
78+
of ``Line2D`` objects; e.g., ``line1, line2 = plot(x1,y1,x2,y2)``. In the code
79+
below we will suppose that we have only
80+
one line so that the list returned is of length 1. We use tuple unpacking with
81+
``line,`` to get the first element of that list::
8082

8183
line, = plt.plot(x, y, '-')
8284
line.set_antialiased(False) # turn off antialising
@@ -179,7 +181,7 @@ which allows you to specify the location as ``axes([left, bottom,
179181
width, height])`` where all values are in fractional (0 to 1)
180182
coordinates. See :ref:`pylab_examples-axes_demo` for an example of
181183
placing axes manually and :ref:`pylab_examples-subplots_demo` for an
182-
example with lots-o-subplots.
184+
example with lots of subplots.
183185

184186

185187
You can create multiple figures by using multiple
@@ -204,11 +206,12 @@ as your heart desires::
204206

205207
You can clear the current figure with :func:`~matplotlib.pyplot.clf`
206208
and the current axes with :func:`~matplotlib.pyplot.cla`. If you find
207-
this statefulness, annoying, don't despair, this is just a thin
209+
it annoying that states, like which figure is current, are being maintained for
210+
you behind the scenes, don't despair: this is just a thin
208211
stateful wrapper around an object oriented API, which you can use
209212
instead (see :ref:`artist-tutorial`)
210213

211-
If you are making a long sequence of figures, you need to be aware of one
214+
If you are making lots of figures, you need to be aware of one
212215
more thing: the memory required for a figure is not completely
213216
released until the figure is explicitly closed with
214217
:func:`~matplotlib.pyplot.close`. Deleting all references to the
@@ -266,7 +269,7 @@ Annotating text
266269
---------------
267270

268271
The uses of the basic :func:`~matplotlib.pyplot.text` command above
269-
place text at an arbitrary position on the Axes. A common use case of
272+
place text at an arbitrary position on the Axes. A common use for
270273
text is to annotate some feature of the plot, and the
271274
:func:`~matplotlib.pyplot.annotate` method provides helper
272275
functionality to make annotations easy. In an annotation, there are

0 commit comments

Comments
 (0)