@@ -7,10 +7,11 @@ Pyplot tutorial
77:mod: `matplotlib.pyplot ` is a collection of command style functions
88that make matplotlib work like MATLAB.
99Each ``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
1415functions are directed to the current axes (please note that "axes" here
1516and 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,
179181width, height]) `` where all values are in fractional (0 to 1)
180182coordinates. See :ref: `pylab_examples-axes_demo ` for an example of
181183placing axes manually and :ref: `pylab_examples-subplots_demo ` for an
182- example with lots-o- subplots.
184+ example with lots of subplots.
183185
184186
185187You can create multiple figures by using multiple
@@ -204,11 +206,12 @@ as your heart desires::
204206
205207You can clear the current figure with :func: `~matplotlib.pyplot.clf `
206208and 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
208211stateful wrapper around an object oriented API, which you can use
209212instead (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
212215more thing: the memory required for a figure is not completely
213216released 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
268271The 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
270273text is to annotate some feature of the plot, and the
271274:func: `~matplotlib.pyplot.annotate ` method provides helper
272275functionality to make annotations easy. In an annotation, there are
0 commit comments