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

Skip to content

Commit d9eda25

Browse files
committed
Added specifics about which states are saved per tcaswell and put spaces after commas per efiring.
1 parent 237071c commit d9eda25

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

doc/users/pyplot_tutorial.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ same length as y but starts with 0. Hence the x data are
3232
an arbitrary number of arguments. For example, to plot x versus y,
3333
you can issue the command::
3434

35-
plt.plot([1,2,3,4], [1,4,9,16])
35+
plt.plot([1, 2, 3, 4], [1, 4, 9, 16])
3636

3737
For every x, y pair of arguments, there is an optional third argument
3838
which is the format string that indicates the color and line type of
@@ -75,7 +75,7 @@ several ways to set line properties
7575

7676

7777
* 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
78+
of ``Line2D`` objects; e.g., ``line1, line2 = plot(x1, y1, x2, y2)``. In the code
7979
below we will suppose that we have only
8080
one line so that the list returned is of length 1. We use tuple unpacking with
8181
``line,`` to get the first element of that list::
@@ -141,7 +141,7 @@ as argument
141141

142142
.. sourcecode:: ipython
143143

144-
In [69]: lines = plt.plot([1,2,3])
144+
In [69]: lines = plt.plot([1, 2, 3])
145145

146146
In [70]: plt.setp(lines)
147147
alpha: float
@@ -174,7 +174,7 @@ will be created by default if you don't manually specify any axes. The
174174
numcols, fignum`` where ``fignum`` ranges from 1 to
175175
``numrows*numcols``. The commas in the ``subplot`` command are
176176
optional if ``numrows*numcols<10``. So ``subplot(211)`` is identical
177-
to ``subplot(2,1,1)``. You can create an arbitrary number of subplots
177+
to ``subplot(2, 1, 1)``. You can create an arbitrary number of subplots
178178
and axes. If you want to place an axes manually, i.e., not on a
179179
rectangular grid, use the :func:`~matplotlib.pyplot.axes` command,
180180
which allows you to specify the location as ``axes([left, bottom,
@@ -192,22 +192,22 @@ as your heart desires::
192192
import matplotlib.pyplot as plt
193193
plt.figure(1) # the first figure
194194
plt.subplot(211) # the first subplot in the first figure
195-
plt.plot([1,2,3])
195+
plt.plot([1, 2, 3])
196196
plt.subplot(212) # the second subplot in the first figure
197-
plt.plot([4,5,6])
197+
plt.plot([4, 5, 6])
198198

199199

200200
plt.figure(2) # a second figure
201-
plt.plot([4,5,6]) # creates a subplot(111) by default
201+
plt.plot([4, 5, 6]) # creates a subplot(111) by default
202202

203203
plt.figure(1) # figure 1 current; subplot(212) still current
204204
plt.subplot(211) # make subplot(211) in figure1 current
205-
plt.title('Easy as 1,2,3') # subplot 211 title
205+
plt.title('Easy as 1, 2, 3') # subplot 211 title
206206

207207
You can clear the current figure with :func:`~matplotlib.pyplot.clf`
208208
and the current axes with :func:`~matplotlib.pyplot.cla`. If you find
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
209+
it annoying that states (specifically the current figure and axes)
210+
are being maintained for you behind the scenes, don't despair: this is just a thin
211211
stateful wrapper around an object oriented API, which you can use
212212
instead (see :ref:`artist-tutorial`)
213213

0 commit comments

Comments
 (0)