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

Skip to content

Commit 494b1aa

Browse files
committed
Minor changes for flake8
1 parent c86bd80 commit 494b1aa

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

tutorials/introductory/getting_started.py

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# Interactive environments
7171
# ------------------------
7272
#
73-
# The Matplotlib community suggests using `IPython<https://ipython.org/>`_ as
73+
# The Matplotlib community suggests using `IPython <https://ipython.org/>`_ as
7474
# the primary interactive environment.
7575

7676
##############################################################################
@@ -80,25 +80,26 @@
8080
#
8181
# The common conventions for preparing to plot data involve importing the
8282
# necessary libraries with abbreviations for convenience. Both stateful and
83-
# stateless programming require the
84-
# following.
83+
# stateless programming require the following.
8584

8685
import matplotlib.pyplot as plt
8786

87+
##############################################################################
88+
#
8889
# The `pyplot` module in Matplotlib is a collection of functions. The module's
8990
# functions create, manage, and manipulate the current figure and the plotting
90-
# area. NumPy is another scientific library for Python.
91-
91+
# area.
92+
#
9293
# These are the two common strategies for creating plots with Matplotlib.
9394
# - Stateful: The programming is designed to remember preceding events or
94-
# interactions. Matplotlib automatically manages figures and ax(es).
95+
# interactions. Matplotlib automatically manages figures and axes.
9596
# - `pyplot`, most similar to MATLAB and convenient for interactive
9697
# environments.
9798
# - Stateless: Code has explicit references to objects. Users create objects
98-
# for specific figures and ax(es) and call on methods for manipulating data.
99-
# - Object-oriented programming, robust control and useful for generalized
100-
# code.
101-
99+
# for specific figures and axes and call on methods for manipulating data.
100+
# - Object-oriented programming (OOP), robust control and useful for
101+
# generalized code.
102+
#
102103
# .. note::
103104
#
104105
# The Matplotlib community does not recommend interchanging stateful and
@@ -108,7 +109,10 @@
108109
#
109110
# For other techniques of creating plots with Matplotlib, refer to
110111
# """insert reference""".
111-
112+
#
113+
# Data
114+
# ----
115+
#
112116
# The Matplotlib library manages data in the form of iterables and/or
113117
# sequenced items. These can also take the form of NumPy arrays like
114118
# `numpy.array` or `numpy.ma.masked_array`. All plotting functions take these
@@ -130,6 +134,8 @@
130134
svg_acct_10 = [1550, 1600, 1650, 1700, 1750, 1800,
131135
1850, 1900, 1950, 2000, 2050, 2100]
132136

137+
##############################################################################
138+
#
133139
# .. note::
134140
#
135141
# Other containers, such as `pandas` data objects, may not work as intended.
@@ -158,20 +164,22 @@
158164
plt.title("Personal Financial Tracking from 2009")
159165
plt.legend()
160166

161-
# Stateless: Object Oriented Programming
162-
# --------------------------------------
167+
##############################################################################
168+
#
169+
# Stateless: Object Oriented Programming (OOP)
170+
# --------------------------------------------
163171
#
164172
# To use stateless programming for Matplotlib involves using a single
165173
# instance of the `pyplot` module to unpack the explicit figure(s) and
166174
# ax(es). Each axes has its own methods to plot data. Also, each axes
167175
# also uses separate methods to create and manage parts of a figure.
168176

169-
"""Stateless programming with Object Oriented Programming"""
177+
"""Stateless programming with OOP"""
170178

171179
y4 = chk_acct_10
172180
y5 = svg_acct_10
173181

174-
fig, ax = plt.subplots() # Figure & axes unpacked separately w/ module.
182+
fig, ax = plt.subplots() # Figure & axes unpacked separately with module.
175183

176184
ax.plot(x, y1, label='Checking Account')
177185
ax.plot(x, y4, label='Savings Account')

0 commit comments

Comments
 (0)