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

Skip to content

Commit a2046fc

Browse files
committed
Make intro tutorial less jargony.
The term of "state-machine" seems a bit too complex for what it's worth. (Also remove mention of pylab at the very beginning.)
1 parent b0c808d commit a2046fc

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

tutorials/introductory/usage.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,15 @@
149149
# Matplotlib, pyplot and pylab: how are they related?
150150
# ====================================================
151151
#
152-
# Matplotlib is the whole package; :mod:`matplotlib.pyplot`
153-
# is a module in matplotlib; and :mod:`pylab` is a module
154-
# that gets installed alongside :mod:`matplotlib`.
152+
# Matplotlib is the whole package and :mod:`matplotlib.pyplot` is a module in
153+
# Matplotlib.
155154
#
156-
# Pyplot provides the state-machine interface to the underlying
157-
# object-oriented plotting library. The state-machine implicitly and
158-
# automatically creates figures and axes to achieve the desired
159-
# plot. For example:
155+
# For functions in the pyplot module, there is always a "current" figure and
156+
# axes (which is created automatically on request). For example, in the
157+
# following example, the first call to ``plt.plot`` creates the axes, then
158+
# subsequent calls to ``plt.plot`` add additional lines on the same axes, and
159+
# ``plt.xlabel``, ``plt.ylabel``, ``plt.title`` and ``plt.legend`` set the
160+
# axes labels and title and add a legend.
160161

161162
x = np.linspace(0, 2, 100)
162163

@@ -174,16 +175,9 @@
174175
plt.show()
175176

176177
###############################################################################
177-
# The first call to ``plt.plot`` will automatically create the necessary
178-
# figure and axes to achieve the desired plot. Subsequent calls to
179-
# ``plt.plot`` re-use the current axes and each add another line.
180-
# Setting the title, legend, and axis labels also automatically use the
181-
# current axes and set the title, create the legend, and label the axis
182-
# respectively.
183-
#
184178
# :mod:`pylab` is a convenience module that bulk imports
185179
# :mod:`matplotlib.pyplot` (for plotting) and :mod:`numpy`
186-
# (for mathematics and working with arrays) in a single name space.
180+
# (for mathematics and working with arrays) in a single namespace.
187181
# pylab is deprecated and its use is strongly discouraged because
188182
# of namespace pollution. Use pyplot instead.
189183
#

0 commit comments

Comments
 (0)