Skip to content

Commit 8b4ec3b

Browse files
committed
Add missing spaces after commas.
Plus minor rewordings.
1 parent bdcd9fc commit 8b4ec3b

File tree

22 files changed

+82
-93
lines changed

22 files changed

+82
-93
lines changed

examples/color/custom_cmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
# in the middle of the range.
148148
cdict4 = {**cdict3,
149149
'alpha': ((0.0, 1.0, 1.0),
150-
# (0.25,1.0, 1.0),
150+
# (0.25, 1.0, 1.0),
151151
(0.5, 0.3, 0.3),
152-
# (0.75,1.0, 1.0),
152+
# (0.75, 1.0, 1.0),
153153
(1.0, 1.0, 1.0)),
154154
}
155155

examples/images_contours_and_fields/irregulardatagrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# Note that scipy.interpolate provides means to interpolate data on a grid
5454
# as well. The following would be an alternative to the four lines above:
5555
#from scipy.interpolate import griddata
56-
#zi = griddata((x, y), z, (xi[None,:], yi[:,None]), method='linear')
56+
#zi = griddata((x, y), z, (xi[None, :], yi[:, None]), method='linear')
5757

5858
ax1.contour(xi, yi, zi, levels=14, linewidths=0.5, colors='k')
5959
cntr1 = ax1.contourf(xi, yi, zi, levels=14, cmap="RdBu_r")

examples/pyplots/whats_new_99_spines.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99

1010

11-
def adjust_spines(ax,spines):
11+
def adjust_spines(ax, spines):
1212
for loc, spine in ax.spines.items():
1313
if loc in spines:
1414
spine.set_position(('outward', 10)) # outward by 10 points
@@ -30,24 +30,24 @@ def adjust_spines(ax,spines):
3030

3131
fig = plt.figure()
3232

33-
x = np.linspace(0,2*np.pi,100)
33+
x = np.linspace(0, 2*np.pi, 100)
3434
y = 2*np.sin(x)
3535

36-
ax = fig.add_subplot(2,2,1)
37-
ax.plot(x,y)
38-
adjust_spines(ax,['left'])
36+
ax = fig.add_subplot(2, 2, 1)
37+
ax.plot(x, y)
38+
adjust_spines(ax, ['left'])
3939

40-
ax = fig.add_subplot(2,2,2)
41-
ax.plot(x,y)
42-
adjust_spines(ax,[])
40+
ax = fig.add_subplot(2, 2, 2)
41+
ax.plot(x, y)
42+
adjust_spines(ax, [])
4343

44-
ax = fig.add_subplot(2,2,3)
45-
ax.plot(x,y)
46-
adjust_spines(ax,['left','bottom'])
44+
ax = fig.add_subplot(2, 2, 3)
45+
ax.plot(x, y)
46+
adjust_spines(ax, ['left', 'bottom'])
4747

48-
ax = fig.add_subplot(2,2,4)
49-
ax.plot(x,y)
50-
adjust_spines(ax,['bottom'])
48+
ax = fig.add_subplot(2, 2, 4)
49+
ax.plot(x, y)
50+
adjust_spines(ax, ['bottom'])
5151

5252
plt.show()
5353

examples/text_labels_and_annotations/accented_text.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
66
Matplotlib supports accented characters via TeX mathtext or unicode.
77
8-
Using mathtext, the following accents are provided: \hat, \breve, \grave, \bar,
9-
\acute, \tilde, \vec, \dot, \ddot. All of them have the same syntax,
10-
e.g., to make an overbar you do \bar{o} or to make an o umlaut you do
11-
\ddot{o}. The shortcuts are also provided, e.g.,: \"o \'e \`e \~n \.x
12-
\^y
13-
8+
Using mathtext, the following accents are provided: \\hat, \\breve, \\grave,
9+
\\bar, \\acute, \\tilde, \\vec, \\dot, \\ddot. All of them have the same
10+
syntax, e.g. \\bar{o} yields "o overbar", \\ddot{o} yields "o umlaut".
11+
Shortcuts such as \\"o \\'e \\`e \\~n \\.x \\^y are also supported.
1412
"""
13+
1514
import matplotlib.pyplot as plt
1615

1716
# Mathtext demo

examples/text_labels_and_annotations/font_family_rc_sgskip.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
style (e.g., 'serif', 'sans-serif', or 'monospace').
88
99
In the example below, we only allow one font family (Tahoma) for the
10-
sans-serif font style. You the default family with the font.family rc
11-
param, e.g.,::
10+
sans-serif font style. The default family is set with the font.family rcparam,
11+
e.g. ::
1212
1313
rcParams['font.family'] = 'sans-serif'
1414
@@ -17,10 +17,8 @@
1717
1818
rcParams['font.sans-serif'] = ['Tahoma', 'DejaVu Sans',
1919
'Lucida Grande', 'Verdana']
20-
2120
"""
2221

23-
2422
from matplotlib import rcParams
2523
rcParams['font.family'] = 'sans-serif'
2624
rcParams['font.sans-serif'] = ['Tahoma']

examples/user_interfaces/svg_tooltip_sgskip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@
9090
function ShowTooltip(obj) {
9191
var cur = obj.id.split("_")[1];
9292
var tip = svgDocument.getElementById('mytooltip_' + cur);
93-
tip.setAttribute('visibility',"visible")
93+
tip.setAttribute('visibility', "visible")
9494
}
9595
9696
function HideTooltip(obj) {
9797
var cur = obj.id.split("_")[1];
9898
var tip = svgDocument.getElementById('mytooltip_' + cur);
99-
tip.setAttribute('visibility',"hidden")
99+
tip.setAttribute('visibility', "hidden")
100100
}
101101
102102
]]>

lib/matplotlib/_constrained_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ def _align_spines(fig, gs):
402402
# different sizes if they occupy different amounts
403403
# of the gridspec: i.e.
404404
# gs = gridspec.GridSpec(3, 1)
405-
# ax1 = gs[0,:]
406-
# ax2 = gs[1:,:]
405+
# ax1 = gs[0, :]
406+
# ax2 = gs[1:, :]
407407
# then drows0 = 1, and drowsC = 2, and ax2
408408
# should be at least twice as large as ax1.
409409
# But it can be more than twice as large because

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5970,7 +5970,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
59705970
quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
59715971
``C[i, j]``.
59725972
- 'gouraud': Each quad will be Gouraud shaded: The color of the
5973-
corners (i', j') are given by ``C[i',j']``. The color values of
5973+
corners (i', j') are given by ``C[i', j']``. The color values of
59745974
the area in between is interpolated from the corner values.
59755975
When Gouraud shading is used, *edgecolors* is ignored.
59765976
@@ -6309,7 +6309,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63096309
63106310
Compute and draw the histogram of *x*. The return value is a tuple
63116311
(*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*, [*patches0*,
6312-
*patches1*,...]) if the input contains multiple data. See the
6312+
*patches1*, ...]) if the input contains multiple data. See the
63136313
documentation of the *weights* parameter to draw a histogram of
63146314
already-binned data.
63156315

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ def _initialize_x_y(self, z):
16611661
`.imshow`: it gives the outer pixel boundaries. In this case, the
16621662
position of Z[0, 0] is the center of the pixel, not a corner. If
16631663
*origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0],
1664-
and (*x1*, *y1*) is the position of Z[-1,-1].
1664+
and (*x1*, *y1*) is the position of Z[-1, -1].
16651665
16661666
This argument is ignored if *X* and *Y* are specified in the call
16671667
to contour.

lib/matplotlib/spines.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Spine(mpatches.Patch):
1818
positions. See function:`~matplotlib.spines.Spine.set_position`
1919
for more information.
2020
21-
The default position is ``('outward',0)``.
21+
The default position is ``('outward', 0)``.
2222
2323
Spines are subclasses of class:`~matplotlib.patches.Patch`, and
2424
inherit much of their behavior.
@@ -379,28 +379,23 @@ def draw(self, renderer):
379379
return ret
380380

381381
def set_position(self, position):
382-
"""Set the position of the spine.
382+
"""
383+
Set the position of the spine.
383384
384385
Spine position is specified by a 2 tuple of (position type,
385386
amount). The position types are:
386387
387-
* 'outward' : place the spine out from the data area by the
388-
specified number of points. (Negative values specify placing the
389-
spine inward.)
390-
391-
* 'axes' : place the spine at the specified Axes coordinate (from
392-
0.0-1.0).
393-
394-
* 'data' : place the spine at the specified data coordinate.
388+
* 'outward': place the spine out from the data area by the specified
389+
number of points. (Negative values place the spine inwards.)
390+
* 'axes': place the spine at the specified Axes coordinate (0 to 1).
391+
* 'data': place the spine at the specified data coordinate.
395392
396393
Additionally, shorthand notations define a special positions:
397394
398-
* 'center' -> ('axes',0.5)
395+
* 'center' -> ('axes', 0.5)
399396
* 'zero' -> ('data', 0.0)
400-
401397
"""
402-
if position in ('center', 'zero'):
403-
# special positions
398+
if position in ('center', 'zero'): # special positions
404399
pass
405400
else:
406401
if len(position) != 2:
@@ -409,9 +404,7 @@ def set_position(self, position):
409404
raise ValueError("position[0] should be one of 'outward', "
410405
"'axes', or 'data' ")
411406
self._position = position
412-
413407
self.set_transform(self.get_spine_transform())
414-
415408
if self.axis is not None:
416409
self.axis.reset_ticks()
417410
self.stale = True

0 commit comments

Comments
 (0)