8000 Fix a bunch of random typos. · matplotlib/matplotlib@287cb58 · GitHub
[go: up one dir, main page]

Skip to content

Commit 287cb58

Browse files
committed
Fix a bunch of random typos.
1 parent 5f555f8 commit 287cb58

File tree

12 files changed

+43
-43
lines changed

12 files changed

+43
-43
lines changed

doc/api/next_api_changes/removals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,4 @@ mathtext
163163
- The ``\stackrel`` command (which behaved differently from its LaTeX version)
164164
has been removed. Use ``\genfrac`` instead.
165165
- The ``\mathcircled`` command has been removed. Directly use Unicode
166-
characters, such as ``'\N{CIRCLED LATIN CAPITAL LETTER A}``, instead.
166+
characters, such as ``'\N{CIRCLED LATIN CAPITAL LETTER A}'``, instead.

doc/users/next_whats_new/2019-12-20-set_xy_position

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ Align labels to axes edges
22
--------------------------
33
`~.axes.Axes.set_xlabel`, `~.axes.Axes.set_ylabel` and `ColorbarBase.set_label`
44
support a parameter ``loc`` for simplified positioning. Supported values are
5-
'left', 'center', 'right' The default is controlled via :rc:`xaxis.labelposition`
6-
and :rc:`yaxis.labelposition`; the Colorbar label takes the rcParam based on its
7-
orientation.
5+
'left', 'center', or 'right'. The default is controlled via
6+
:rc:`xaxis.labelposition` and :rc:`yaxis.labelposition`; the Colorbar label
7+
takes the rcParam based on its orientation.

examples/images_contours_and_fields/pcolormesh_grids.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# ------------
2525
#
2626
# The grid specification with the least assumptions is ``shading='flat'``
27-
# and if the grid is one larger than the data in each dimesion, i.e. has shape
28-
# *(M+1, N+1)*. In that case *X* and *Y* sepcify the corners of quadrilaterals
27+
# and if the grid is one larger than the data in each dimension, i.e. has shape
28+
# *(M+1, N+1)*. In that case *X* and *Y* specify the corners of quadrilaterals
2929
# that are colored with the values in *Z*. Here we specify the edges of the
3030
# *(3, 5)* quadrilaterals with *X* and *Y* that are *(4, 6)*.
3131

@@ -71,8 +71,8 @@ def _annotate(ax, x, y, title):
7171
# --------------------------------
7272
#
7373
# Usually, dropping a row and column of data is not what the user means when
74-
# the make *X*, *Y* and *Z* all the same shape. For this case, Matplotlib
75-
# allows ``shading='nearest'`` and centers the colored qudrilaterals on the
74+
# they make *X*, *Y* and *Z* all the same shape. For this case, Matplotlib
75+
# allows ``shading='nearest'`` and centers the colored quadrilaterals on the
7676
# grid points.
7777
#
7878
# If a grid that is not the correct shape is passed with ``shading='nearest'``
@@ -86,9 +86,9 @@ def _annotate(ax, x, y, title):
8686
# Auto Shading
8787
# ------------
8888
#
89-
# Its possible that the user would like the code to automatically choose
90-
# which to use, in which case ``shading='auto'`` will decide whether to
91-
# use 'flat' or 'nearest' shading based on the shapes of *X*, *Y* and *Z*.
89+
# It's possible that the user would like the code to automatically choose which
90+
# to use, in this case ``shading='auto'`` will decide whether to use 'flat' or
91+
# 'nearest' shading based on the shapes of *X*, *Y* and *Z*.
9292

9393
fig, axs = plt.subplots(2, 1, constrained_layout=True)
9494
ax = axs[0]
@@ -108,9 +108,8 @@ def _annotate(ax, x, y, title):
108108
# ---------------
109109
#
110110
# `Gouraud shading <https://en.wikipedia.org/wiki/Gouraud_shading>`_ can also
111-
# be specified, where the colour in the quadrilaterals is linearly
112-
# interpolated between the grid points. The shapes of *X*, *Y*, *Z* must
113-
# be the same.
111+
# be specified, where the color in the quadrilaterals is linearly interpolated
112+
# between the grid points. The shapes of *X*, *Y*, *Z* must be the same.
114113

115114
fig, ax = plt.subplots(constrained_layout=True)
116115
x = np.arange(ncols)

examples/misc/cursor_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class SnappingCursor:
168168
A cross hair cursor that snaps to the data point of a line, which is
169169
closest to the *x* position of the cursor.
170170
171-
For simplicity, this assumes that *x* values of the data is sorted.
171+
For simplicity, this assumes that *x* values of the data are sorted.
172172
"""
173173
def __init__(self, ax, line):
174174
self.ax = ax

examples/widgets/rectangle_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def line_select_callback(eclick, erelease):
2525
x1, y1 = eclick.xdata, eclick.ydata
2626
x2, y2 = erelease.xdata, erelease.ydata
2727
print(f"({x1:3.2f}, {y1:3.2f}) --> ({x2:3.2f}, {y2:3.2f})")
28-
print(" The button you used were: {eclick.button} {erelease.button}")
28+
print(f" The buttons you used were: {eclick.button} {erelease.button}")
2929

3030

3131
def toggle_selector(event):

lib/matplotlib/axes/_axes.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, *,
204204
205205
loc : {'left', 'center', 'right'}, default: :rc:`xaxis.labellocation`
206206
The label position. This is a high-level alternative for passing
207-
parameters *x* and *horizonatalalignment*.
207+
parameters *x* and *horizontalalignment*.
208208
209209
Other Parameters
210210
----------------
@@ -213,16 +213,17 @@ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, *,
213213
214214
See also
215215
--------
216-
text : for information on how override and the optional args work
216+
text : for information on how override and the optional arguments work
217217
"""
218218
if labelpad is not None:
219219
self.xaxis.labelpad = labelpad
220220
protected_kw = ['x', 'horizontalalignment', 'ha']
221221
if {*kwargs} & {*protected_kw}:
222222
if loc is not None:
223223
raise TypeError(f"Specifying 'loc' is disallowed when any of "
224-
f"its corresponding low level kwargs "
225-
f"({protected_kw}) are supplied as well")
224+
f"its corresponding low level keyword "
225+
f"arguments ({protected_kw}) are also "
226+
f"supplied")
226227
loc = 'center'
227228
else:
228229
loc = loc if loc is not None else rcParams['xaxis.labellocation']
@@ -256,7 +257,7 @@ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, *,
256257
257258
loc : {'bottom', 'center', 'top'}, default: :rc:`yaxis.labellocation`
258259
The label position. This is a high-level alternative for passing
259-
parameters *y* and *horizonatalalignment*.
260+
parameters *y* and *horizontalalignment*.
260261
261262
Other Parameters
262263
----------------
@@ -265,17 +266,17 @@ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, *,
265266
266267
See also
267268
--------
268-
text : for information on how override and the optional args work
269-
269+
text : for information on how override and the optional arguments work
270270
"""
271271
if labelpad is not None:
272272
self.yaxis.labelpad = labelpad
273273
protected_kw = ['y', 'horizontalalignment', 'ha']
274274
if {*kwargs} & {*protected_kw}:
275275
if loc is not None:
276276
raise TypeError(f"Specifying 'loc' is disallowed when any of "
277-
f"its corresponding low level kwargs "
278-
f"({protected_kw}) are supplied as well")
277+
f"its corresponding low level keyword "
278+
f"arguments ({protected_kw}) are also "
279+
f"supplied")
279280
loc = 'center'
280281
else:
281282
loc = loc if loc is not None else rcParams['yaxis.labellocation']
@@ -5780,7 +5781,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
57805781
57815782
shading : {'flat', 'nearest', 'auto'}, optional
57825783
The fill style for the quadrilateral; defaults to 'flat' or
5783-
':rc:`pcolor.shading`. Possible values:
5784+
:rc:`pcolor.shading`. Possible values:
57845785
57855786
- 'flat': A solid color is used for each quad. The color of the
57865787
quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
@@ -6060,7 +6061,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
60606061
60616062
shading : {'flat', 'nearest', 'gouraud', 'auto'}, optional
60626063
The fill style for the quadrilateral; defaults to
6063-
'flat' or ':rc:`pcolor.shading`. Possible values:
6064+
'flat' or :rc:`pcolor.shading`. Possible values:
60646065
60656066
- 'flat': A solid color is used for each quad. The color of the
60666067
quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
@@ -6076,7 +6077,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
60766077
the area in between is interpolated from the corner values.
60776078
The dimensions of *X* and *Y* must be the same as *C*. When
60786079
Gouraud shading is used, *edgecolors* is ignored.
6079-
- 'auto': Choose 'flat' if diemnsions of *X* and *Y* are one
6080+
- 'auto': Choose 'flat' if dimensions of *X* and *Y* are one
60806081
larger than *C*. Choose 'nearest' if dimensions are the same.
60816082
60826083
See :doc:`/gallery/images_contours_and_fields/pcolormesh_grids`

lib/matplotlib/colorbar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,9 @@ def set_label(self, label, *, loc=None, **kwargs):
754754
_protected_kw = [_pos_xy, 'horizontalalignment', 'ha']
755755
if any([k in kwargs for k in _protected_kw]):
756756
if loc is not None:
757-
raise TypeError('Specifying *loc* is disallowed when any of '
758-
'its corresponding low level kwargs {} '
759-
'are supplied as well.'.format(_protected_kw))
757+
raise TypeError(f'Specifying *loc* is disallowed when any of '
758+
f'its corresponding low level keyword '
759+
f'arguments {_protected_kw} are also supplied')
760760
loc = 'center'
761761
else:
762762
if loc is None:

lib/matplotlib/tests/test_mathtext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
all = [digits, uppercase, lowercase, uppergreek, lowergreek]
122122

123123
# Use stubs to reserve space if tests are removed
124-
# stub should be of the form (None, N) where is the number of
125-
# strings that used to be tested
124+
# stub should be of the form (None, N) where N is the number of strings that
125+
# used to be tested
126126
# Add new tests at the end.
127127
font_test_specs = [
128128
([], all),

matplotlibrc.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@
408408
#axes3d.grid : True # display grid on 3d axes
409409

410410
## ***************************************************************************
411-
## * AXIS *
411+
## * AXIS *
412412
## ***************************************************************************
413-
#xaxis.labellocation : center ## alignment of the xaxis label: {left, right, center}
414-
#yaxis.labellocation : center ## alignment of the yaxis label: {bottom, top, center}
413+
#xaxis.labellocation : center # alignment of the xaxis label: {left, right, center}
414+
#yaxis.labellocation : center # alignment of the yaxis label: {bottom, top, center}
415415

416416

417417
## ***************************************************************************

tutorials/advanced/patheffects_guide.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
1313
Artists which can have a path effect applied to them include `.patches.Patch`,
1414
`.lines.Line2D`, `.collections.Collection` and even `.text.Text`. Each artist's
15-
path effects can be controlled via the `.Artist.set_path_effects` method ,
15+
path effects can be controlled via the `.Artist.set_path_effects` method,
1616
which takes an iterable of `AbstractPathEffect` instances.
1717
18-
The simplest path effect is the `Normal` effect, which simply
19-
draws the artist without any effect:
18+
The simplest path effect is the `Normal` effect, which simply draws the artist
19+
without any effect:
2020
"""
2121

2222
import matplotlib.pyplot as plt
@@ -31,7 +31,7 @@
3131

3232
###############################################################################
3333
# Whilst the plot doesn't look any different to what you would expect without
34-
# any path effects, the drawing of the text now been changed to use the
34+
# any path effects, the drawing of the text has now been changed to use the
3535
# path effects framework, opening up the possibilities for more interesting
3636
# examples.
3737
#

tutorials/intermediate/artists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class in the matplotlib API, and the one you will be working with most
339339
# ================ ============================================================
340340
# axes A list of Axes instances (includes Subplot)
341341
# patch The Rectangle background
342-
# images A list of FigureImages patches -
342+
# images A list of FigureImage patches -
343343
# useful for raw pixel display
344344
# legends A list of Figure Legend instances
345345
# (different from Axes.legends)

tutorials/intermediate/gridspec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464

6565
#############################################################################
6666
# The power of gridspec comes in being able to create subplots that span
67-
# rows and columns. Note the `Numpy slice
67+
# rows and columns. Note the `NumPy slice syntax
6868
# <https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html>`_
69-
# syntax for selecting the part of the gridspec each subplot will occupy.
69+
# for selecting the part of the gridspec each subplot will occupy.
7070
#
7171
# Note that we have also used the convenience method `.Figure.add_gridspec`
7272
# instead of `.gridspec.GridSpec`, potentially saving the user an import,

0 commit comments

Comments
 (0)
0