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

Skip to content

Commit ef07beb

Browse files
committed
Continued work on prose
1 parent 291123a commit ef07beb

File tree

1 file changed

+45
-32
lines changed

1 file changed

+45
-32
lines changed

tutorials/introductory/getting_started.py

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# visualizations involve taking data and transforming it through functions and
2121
# methods.
2222
#
23-
# There are two main ways of producing plots with Matplotlib, stateful and
23+
# There are two main ways of producing graphs with Matplotlib, stateful and
2424
# stateless. Stateful code, using `pyplot`, or stateless code, using Object
2525
# Oriented Programming (OOP), are the foundation for creating and manipulating
2626
# data into visualizations.
@@ -34,7 +34,7 @@
3434
# Stateless programming, OOP, helps users generalize code and is useful for
3535
# repeated uses or larger projects. This is also a more robust way of
3636
# controlling customizations for visualizations. Users looking to have control
37-
# over every part of the plot can call methods on each item.
37+
# over every part of the graph can call methods on each item.
3838
#
3939
#
4040
#
@@ -45,33 +45,38 @@
4545
# Requirements
4646
# ============
4747
#
48-
# Matplotlib is a Python library. Depending on your operating system, Python
49-
# may already be installed on your machine.
48+
# Matplotlib is a Python library and an installed version of Python 3.6 or
49+
# higher is required. Depending on your operating system, Python may already
50+
# be installed on your machine.
5051
#
5152
# Installing Maptlotlib is required in order to generate plots with the
5253
# library. You can install Matplotlib for your own development environment(s)
5354
# or use a third-party package distribution.
5455
#
5556
# Third-party package distributions, such as
56-
# `Anaconda <https://www.anaconda.com/>`_
57-
# , `ActiveState <https://www.activestate.com/activepython/downloads>`_
58-
# , or `WinPython <https://winpython.github.io/>`_,
59-
# already provide Matplotlib and its dependencies. These packages work as is
60-
# and do not require additional installations.
57+
# `Anaconda <https://www.anaconda.com/>`_,
58+
# `ActiveState <https://www.activestate.com/activepython/downloads>`_,
59+
# or `WinPython <https://winpython.github.io/>`_,
60+
# already provide Matplotlib and its dependencies. They have the added benefit
61+
# of including other scientific Python libraries as well. These packages work
62+
# as is and do not require additional installations.
6163
#
6264
# Installation from source
6365
# ------------------------
6466
#
65-
# The following command line executions use Python to install Matplotlib.
67+
# In order to install Matplotlib from the source directory, you can run the
68+
# following command line executions using Python and installer program `pip`
69+
# for the latest version of Matplotlib and its dependencies. This will compile
70+
# the library from the current directory on your machine.
6671
#
67-
# `python -m pip install -U pip`
68-
# `python -m pip install -U matplotlib`
72+
# `python -m pip install matplotlib`
6973
#
7074
# Interactive environments
7175
# ------------------------
7276
#
73-
# The Matplotlib community suggests using `IPython <https://ipython.org/>`_ as
74-
# the primary interactive environment.
77+
# The Matplotlib community suggests using `IPython <https://ipython.org/>`_
78+
# through `Jupyter <https://jupyter.org/index.html>`_ as the primary
79+
# interactive environment.
7580

7681
##############################################################################
7782
#
@@ -91,14 +96,15 @@
9196
# area.
9297
#
9398
# These are the two common strategies for creating plots with Matplotlib.
94-
# - Stateful: The programming is designed to remember preceding events or
95-
# interactions. Matplotlib automatically manages figures and axes.
96-
# - `pyplot`, most similar to MATLAB and convenient for interactive
97-
# environments.
98-
# - Stateless: Code has explicit references to objects. Users create objects
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.
99+
#
100+
# * Stateful: The programming is designed to remember preceding events or
101+
# interactions. Matplotlib automatically manages figures and axes.
102+
# * `pyplot`, most similar to MATLAB and convenient for interactive
103+
# environments.
104+
# * Stateless: Code has explicit references to objects. Users create objects
105+
# for specific figures and axes and call on methods for manipulating data.
106+
# * Object-oriented programming (OOP), robust control and useful for
107+
# generalized code.
102108
#
103109
# .. note::
104110
#
@@ -138,7 +144,8 @@
138144
#
139145
# .. note::
140146
#
141-
# Other containers, such as `pandas` data objects, may not work as intended.
147+
# Other containers, such as `pandas` data objects, may not work as
148+
# intended.
142149
#
143150
# Stateful: `pyplot`
144151
# ------------------
@@ -179,7 +186,7 @@
179186
# of the `pyplot` module to unpack a set or sets of explicit figure and axes.
180187
# Each axes has its own methods to plot data. In addition, each axes also
181188
# uses separate methods to create and manage parts of a figure. These methods
182-
# are different from those using stateful programming.
189+
# are different from those of the stateful programming approach.
183190

184191
# Stateless programming with OOP
185192

@@ -200,20 +207,21 @@
200207
#
201208
# For the OOP example, the figure and axes are unpacked from the module using
202209
# a single instance of `pyplot`. This convention uses `plt.subplots()` and
203-
# defaults to one figure,`fig`, and one axes, `ax`. The section below on
210+
# defaults to one figure, `fig`, and one axes, `ax`. The section below on
204211
# customizations contains additional information about multiple visulizations
205212
# and other modifications.
206213
#
207214
# Using the OOP approach allows for `fig` and `ax` to use separate methods to
208-
# manipulate the visualization. Instead of using the module `pyplot` for each
209-
# instance of managing the objects, the specfic axes refers to OOP usage and
210-
# manages data
215+
# manipulate the visualization. Instead of using the module `pyplot` for all
216+
# instances of managing objects, the specfic axes refers to OOP usage and
217+
# manages the respective data.
211218
#
212219
# .. note::
213220
#
214-
# The names and spelling for methods may be similar for both `pyplot` and OOP
215-
# approaches. Errors may occur when using the wrong corresponding method.
216-
# Confirm with documentation API for specific method names.
221+
# The names and spelling for methods may be similar for both `pyplot` and
222+
# OOP approaches. Errors may occur when using the wrong corresponding
223+
# method. Confirm with the documentation API for specific method names
224+
# according to your programming.
217225

218226
##############################################################################
219227
#
@@ -226,4 +234,9 @@
226234
# Components of Matplotlib Figure
227235
# -------------------------------
228236
#
229-
# This
237+
# The image below depicts each visible element of a Matplotlib graph.
238+
#
239+
# * Figure
240+
# * Axes
241+
# * Axis
242+
# * Artist(s)

0 commit comments

Comments
 (0)