8000 Add missing spaces after commas. · matplotlib/matplotlib@290dfb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 290dfb0

Browse files
committed
Add missing spaces after commas.
... and various other small docstring fixes.
1 parent f51bf2b commit 290dfb0

File tree

98 files changed

+423
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+423
-464
lines changed

examples/axes_grid1/inset_locator_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
ax = fig.add_subplot(121)
5656

5757
# We use the axes transform as bbox_transform. Therefore the bounding box
58-
# needs to be specified in axes coordinates ((0,0) is the lower left corner
59-
# of the axes, (1,1) is the upper right corner).
60-
# The bounding box (.2, .4, .6, .5) starts at (.2,.4) and ranges to (.8,.9)
58+
# needs to be specified in axes coordinates ((0, 0) is the lower left corner
59+
# of the axes, (1, 1) is the upper right corner).
60+
# The bounding box (.2, .4, .6, .5) starts at (.2, .4) and ranges to (.8, .9)
6161
# in those coordinates.
6262
# Inside of this bounding box an inset of half the bounding box' width and
6363
# three quarters of the bounding box' height is created. The lower left corner

examples/event_handling/trifinder_event_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def motion_notify(event):
5454
# Setup plot and callbacks.
5555
plt.subplot(111, aspect='equal')
5656
plt.triplot(triang, 'bo-')
57-
polygon = Polygon([[0, 0], [0, 0]], facecolor='y') # dummy data for xs,ys
57+
polygon = Polygon([[0, 0], [0, 0]], facecolor='y') # dummy data for (xs, ys)
5858
update_polygon(-1)
5959
plt.gca().add_patch(polygon)
6060
plt.gcf().canvas.mpl_connect('motion_notify_event', motion_notify)

examples/event_handling/zoom_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
If you click on a point in the first window, the z and y limits of the second
1010
will be adjusted so that the center of the zoom in the second window will be
11-
the x,y coordinates of the clicked point.
11+
the (x, y) coordinates of the clicked point.
1212
1313
Note the diameter of the circles in the scatter are defined in points**2, so
1414
their size is independent of the zoom.

examples/images_contours_and_fields/image_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
# achieving the look you want. Below we'll display the same (small) array,
7979
# interpolated with three different interpolation methods.
8080
#
81-
# The center of the pixel at A[i,j] is plotted at i+0.5, i+0.5. If you
82-
# are using interpolation='nearest', the region bounded by (i,j) and
83-
# (i+1,j+1) will have the same color. If you are using interpolation,
81+
# The center of the pixel at A[i, j] is plotted at (i+0.5, i+0.5). If you
82+
# are using interpolation='nearest', the region bounded by (i, j) and
83+
# (i+1, j+1) will have the same color. If you are using interpolation,
8484
# the pixel center will have the same color as it does with nearest, but
8585
# other pixels will be interpolated between the neighboring pixels.
8686
#
@@ -129,7 +129,7 @@
129129

130130
###############################################################################
131131
# You can specify whether images should be plotted with the array origin
132-
# x[0,0] in the upper left or lower right by using the origin parameter.
132+
# x[0, 0] in the upper left or lower right by using the origin parameter.
133133
# You can also control the default setting image.origin in your
134134
# :ref:`matplotlibrc file <customizing-with-matplotlibrc-files>`. For more on
135135
# this topic see the :doc:`complete guide on origin and extent

examples/images_contours_and_fields/irregulardatagrid.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
xi = np.linspace(-2.1, 2.1, ngridx)
4545
yi = np.linspace(-2.1, 2.1, ngridy)
4646

47-
# Perform linear interpolation of the data (x,y)
48-
# on a grid defined by (xi,yi)
47+
# Linearly interpolate the data (x, y) on a grid defined by (xi, yi).
4948
triang = tri.Triangulation(x, y)
5049
interpolator = tri.LinearTriInterpolator(triang, z)
5150
Xi, Yi = np.meshgrid(xi, yi)
@@ -56,7 +55,6 @@
5655
#from scipy.interpolate import griddata
5756
#zi = griddata((x, y), z, (xi[None,:], yi[:,None]), method='linear')
5857

59-
6058
ax1.contour(xi, yi, zi, levels=14, linewidths=0.5, colors='k')
6159
cntr1 = ax1.contourf(xi, yi, zi, levels=14, cmap="RdBu_r")
6260

@@ -66,7 +64,6 @@
6664
ax1.set_title('grid and contour (%d points, %d grid points)' %
6765
(npts, ngridx * ngridy))
6866

69-
7067
# ----------
7168
# Tricontour
7269
# ----------

examples/lines_bars_and_markers/psd_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# s = 0.1*sin(2*pi*t) + cnse;
4646
#
4747
# subplot(211)
48-
# plot(t,s)
48+
# plot(t, s)
4949
# subplot(212)
5050
# psd(s, 512, 1/dt)
5151
#

examples/lines_bars_and_markers/scatter_piecharts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
sizes = np.array([60, 80, 120])
2020

2121
# calculate the points of the first pie marker
22-
# these are just the origin (0,0) + some points on a circle cos,sin
22+
# these are just the origin (0, 0) + some (cos, sin) points on a circle
2323
x1 = np.cos(2 * np.pi * np.linspace(0, r1))
2424
y1 = np.sin(2 * np.pi * np.linspace(0, r1))
2525
xy1 = np.row_stack([[0, 0], np.column_stack([x1, y1])])

examples/misc/customize_rc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def set_pub():
2222
2323
>>> set_pub()
2424
>>> subplot(111)
25-
>>> plot([1,2,3])
25+
>>> plot([1, 2, 3])
2626
>>> savefig('myfig')
2727
>>> rcdefaults() # restore the defaults
2828

examples/misc/demo_agg_filter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,16 @@ def drop_shadow_patches(ax):
264264
men_means = [20, 35, 30, 35, 27]
265265

266266
ind = np.arange(N) # the x locations for the groups
267-
width = 0.35 # the width of the bars
267+
width = 0.35 # the width of the bars
268268

269269
rects1 = ax.bar(ind, men_means, width, color='r', ec="w", lw=2)
270270

271271
women_means = [25, 32, 34, 20, 25]
272272
rects2 = ax.bar(ind + width + 0.1, women_means, width,
273273
color='y', ec="w", lw=2)
274274

275-
# gauss = GaussianFilter(1.5, offsets=(1,1), )
276-
gauss = DropShadowFilter(5, offsets=(1, 1), )
275+
# gauss = GaussianFilter(1.5, offsets=(1, 1))
276+
gauss = DropShadowFilter(5, offsets=(1, 1))
277277
shadow = FilteredArtistList(rects1 + rects2, gauss)
278278
ax.add_artist(shadow)
279279
shadow.set_zorder(rects1[0].get_zorder() - 0.1)

examples/misc/set_and_get.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
To set the linestyle of a line to be dashed, you can do::
1313
14-
>>> line, = plt.plot([1,2,3])
14+
>>> line, = plt.plot([1, 2, 3])
1515
>>> plt.setp(line, linestyle='--')
1616
1717
If you want to know the valid types of arguments, you can provide the
@@ -31,7 +31,7 @@
3131
the instances will be set. e.g., suppose you have a list of two lines,
3232
the following will make both lines thicker and red::
3333
34-
>>> x = np.arange(0,1.0,0.01)
34+
>>> x = np.arange(0, 1, 0.01)
3535
>>> y1 = np.sin(2*np.pi*x)
3636
>>> y2 = np.sin(4*np.pi*x)
3737
>>> lines = plt.plot(x, y1, x, y2)

examples/mplot3d/2dcollections3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Plot a sin curve using the x and y axes.
1717
x = np.linspace(0, 1, 100)
1818
y = np.sin(x * 2 * np.pi) / 2 + 0.5
19-
ax.plot(x, y, zs=0, zdir='z', label='curve in (x,y)')
19+
ax.plot(x, y, zs=0, zdir='z', label='curve in (x, y)')
2020

2121
# Plot scatterplot data (20 2D points per colour) on the x and z axes.
2222
colors = ('r', 'g', 'b', 'k')
@@ -30,8 +30,8 @@
3030
for c in colors:
3131
c_list.extend([c] * 20)
3232
# By using zdir='y', the y value of these points is fixed to the zs value 0
33-
# and the (x,y) points are plotted on the x and z axes.
34-
ax.scatter(x, y, zs=0, zdir='y', c=c_list, label='points in (x,z)')
33+
# and the (x, y) points are plotted on the x and z axes.
34+
ax.scatter(x, y, zs=0, zdir='y', c=c_list, label='points in (x, z)')
3535

3636
# Make legend, set axes limits and labels
3737
ax.legend()

examples/mplot3d/contour3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Demonstrates plotting contour (level) curves in 3D
44
==================================================
55
6-
This is like a contour plot in 2D except that the f(x,y)=c curve is plotted
7-
on the plane z=c.
6+
This is like a contour plot in 2D except that the ``f(x, y)=c`` curve is
7+
plotted on the plane ``z=c``.
88
"""
99

1010
from mpl_toolkits.mplot3d import axes3d

examples/mplot3d/polys3d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def polygon_under_graph(xlist, ylist):
2828
fig = plt.figure()
2929
ax = fig.gca(projection='3d')
3030

31-
# Make verts a list, verts[i] will be a list of (x,y) pairs defining polygon i
31+
# Make verts a list such that verts[i] is a list of (x, y) pairs defining
32+
# polygon i.
3233
verts = []
3334

3435
# Set up the x sequence

examples/pie_and_polar_charts/pie_and_donut_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# the pie. Here we use the axes coordinates ``(1, 0, 0.5, 1)`` together
2929
# with the location ``"center left"``; i.e.
3030
# the left central point of the legend will be at the left central point of the
31-
# bounding box, spanning from ``(1,0)`` to ``(1.5,1)`` in axes coordinates.
31+
# bounding box, spanning from ``(1, 0)`` to ``(1.5, 1)`` in axes coordinates.
3232

3333
import numpy as np
3434
import matplotlib.pyplot as plt

examples/pyplots/annotation_polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
fig = plt.figure()
1515
ax = fig.add_subplot(111, polar=True)
16-
r = np.arange(0,1,0.001)
16+
r = np.arange(0, 1, 0.001)
1717
theta = 2 * 2*np.pi * r
1818
line, = ax.plot(theta, r, color='#ee8d18', lw=3)
1919

examples/pyplots/auto_subplots_adjust.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17 10000 ,7 +17,7 @@
1717

1818
fig, ax = plt.subplots()
1919
ax.plot(range(10))
20-
ax.set_yticks((2,5,7))
20+
ax.set_yticks((2, 5, 7))
2121
labels = ax.set_yticklabels(('really, really, really', 'long', 'labels'))
2222

2323
def on_draw(event):

examples/pyplots/boxplot_demo_pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
# This is actually more efficient because boxplot converts
7575
# a 2-D array into a list of vectors internally anyway.
7676

77-
data = [data, d2, d2[::2,0]]
77+
data = [data, d2, d2[::2, 0]]
7878
fig7, ax7 = plt.subplots()
7979
ax7.set_title('Multiple Samples with Different sizes')
8080
ax7.boxplot(data)

examples/pyplots/pyplot_mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
t = np.arange(0.0, 2.0, 0.01)
1212
s = np.sin(2*np.pi*t)
1313

14-
plt.plot(t,s)
14+
plt.plot(t, s)
1515
plt.title(r'$\alpha_i > \beta_i$', fontsize=20)
1616
plt.text(1, -0.6, r'$\sum_{i=0}^\infty x_i$', fontsize=20)
1717
plt.text(0.6, 0.6, r'$\mathcal{A}\mathrm{sin}(2 \omega t)$',

examples/pyplots/pyplot_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A most simple plot, where a list of numbers is plotted against their index.
77
"""
88
import matplotlib.pyplot as plt
9-
plt.plot([1,2,3,4])
9+
plt.plot([1, 2, 3, 4])
1010
plt.ylabel('some numbers')
1111
plt.show()
1212

examples/pyplots/text_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
top = bottom + height
1616

1717
fig = plt.figure()
18-
ax = fig.add_axes([0,0,1,1])
18+
ax = fig.add_axes([0, 0, 1, 1])
1919

20-
# axes coordinates are 0,0 is bottom left and 1,1 is upper right
20+
# axes coordinates: (0, 0) is bottom left and (1, 1) is upper right
2121
p = patches.Rectangle(
2222
(left, bottom), width, height,
2323
fill=False, transform=ax.transAxes, clip_on=False

examples/shapes_and_collections/collections.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
The third subplot will make regular polygons, with the same
1313
type of scaling and positioning as in the first two.
1414
15-
The last subplot illustrates the use of "offsets=(xo,yo)",
15+
The last subplot illustrates the use of "offsets=(xo, yo)",
1616
that is, a single tuple instead of a list of tuples, to generate
1717
successively offset curves, with the offset given in data
1818
units. This behavior is available only for the LineCollection.
19-
2019
'''
2120

2221
import matplotlib.pyplot as plt
@@ -53,7 +52,7 @@
5352
trans = fig.dpi_scale_trans + transforms.Affine2D().scale(1.0/72.0)
5453
col.set_transform(trans) # the points to pixels transform
5554
# Note: the first argument to the collection initializer
56-
# must be a list of sequences of x,y tuples; we have only
55+
# must be a list of sequences of (x, y) tuples; we have only
5756
# one sequence, but we still have to put it in a list.
5857
ax1.add_collection(col, autolim=True)
5958
# autolim=True enables autoscaling. For collections with

examples/shapes_and_collections/line_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
# If linestyle is omitted, 'solid' is used
7272
# See :class:`matplotlib.collections.LineCollection` for more information
7373

74-
# Make a sequence of x,y pairs
74+
# Make a sequence of (x, y) pairs.
7575
line_segments = LineCollection([np.column_stack([x, y]) for y in ys],
7676
linewidths=(0.5, 1, 1.5, 2),
7777
linestyles='solid')

examples/specialty_plots/leftventricle_bulleye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,6 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
205205

206206
bullseye_plot(ax[2], data, seg_bold=[3, 5, 6, 11, 12, 16],
207207
cmap=cmap3, norm=norm3)
208-
ax[2].set_title('Segments [3,5,6,11,12,16] in bold')
208+
ax[2].set_title('Segments [3, 5, 6, 11, 12, 16] in bold')
209209

210210
plt.show()

examples/statistics/boxplot_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
# properties of the original sample, and a boxplot is one visual tool
8383
# to make this assessment
8484

85-
random_dists = ['Normal(1,1)', ' Lognormal(1,1)', 'Exp(1)', 'Gumbel(6,4)',
86-
'Triangular(2,9,11)']
85+
random_dists = ['Normal(1, 1)', 'Lognormal(1, 1)', 'Exp(1)', 'Gumbel(6, 4)',
86+
'Triangular(2, 9, 11)']
8787
N = 500
8888

8989
norm = np.random.normal(1, 1, N)

examples/subplots_axes_and_figures/broken_axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
# This looks pretty good, and was fairly painless, but you can get that
4343
# cut-out diagonal lines look with just a bit more work. The important
4444
# thing to know here is that in axes coordinates, which are always
45-
# between 0-1, spine endpoints are at these locations (0,0), (0,1),
46-
# (1,0), and (1,1). Thus, we just need to put the diagonals in the
45+
# between 0-1, spine endpoints are at these locations (0, 0), (0, 1),
46+
# (1, 0), and (1, 1). Thus, we just need to put the diagonals in the
4747
# appropriate corners of each of our axes, and so long as we use the
4848
# right transform and disable clipping.
4949

examples/subplots_axes_and_figures/subplots_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@
7878

7979
fig, axs = plt.subplots(2, 2)
8080
axs[0, 0].plot(x, y)
81-
axs[0, 0].set_title('Axis [0,0]')
81+
axs[0, 0].set_title('Axis [0, 0]')
8282
axs[0, 1].plot(x, y, 'tab:orange')
83-
axs[0, 1].set_title('Axis [0,1]')
83+
axs[0, 1].set_title('Axis [0, 1]')
8484
axs[1, 0].plot(x, -y, 'tab:green')
85-
axs[1, 0].set_title('Axis [1,0]')
85+
axs[1, 0].set_title('Axis [1, 0]')
8686
axs[1, 1].plot(x, -y, 'tab:red')
87-
axs[1, 1].set_title('Axis [1,1]')
87+
axs[1, 1].set_title('Axis [1, 1]')
8888

8989
for ax in axs.flat:
9090
ax.set(xlabel='x-label', ylabel='y-label')

examples/text_labels_and_annotations/annotation_demo.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
# Specifying text points and annotation points
2121
# --------------------------------------------
2222
#
23-
# You must specify an annotation point `xy=(x,y)` to annotate this point.
24-
# additionally, you may specify a text point `xytext=(x,y)` for the
23+
# You must specify an annotation point `xy=(x, y)` to annotate this point.
24+
# additionally, you may specify a text point `xytext=(x, y)` for the
2525
# location of the text for this annotation. Optionally, you can
2626
# specify the coordinate system of `xy` and `xytext` with one of the
2727
# following strings for `xycoords` and `textcoords` (default is 'data')::
2828
#
29-
# 'figure points' : points from the lower left corner of the figure
30-
# 'figure pixels' : pixels from the lower left corner of the figure
31-
# 'figure fraction' : 0,0 is lower left of figure and 1,1 is upper, right
32-
# 'axes points' : points from lower left corner of axes
33-
# 'axes pixels' : pixels from lower left corner of axes
34-
# 'axes fraction' : 0,0 is lower left of axes and 1,1 is upper right
35-
# 'offset points' : Specify an offset (in points) from the xy value
36-
# 'offset pixels' : Specify an offset (in pixels) from the xy value
37-
# 'data' : use the axes data coordinate system
29+
# 'figure points' : points from the lower left corner of the figure
30+
# 'figure pixels' : pixels from the lower left corner of the figure
31+
# 'figure fraction' : (0, 0) is lower left of figure and (1, 1) is upper right
32+
# 'axes points' : points from lower left corner of axes
33+
# 'axes pixels' : pixels from lower left corner of axes
34+
# 'axes fraction' : (0, 0) is lower left of axes and (1, 1) is upper right
35+
# 'offset points' : Specify an offset (in points) from the xy value
36+
# 'offset pixels' : Specify an offset (in pixels) from the xy value
37+
# 'data' : use the axes data coordinate system
3838
#
3939
# Note: for physical coordinate systems (points or pixels) the origin is the
4040
# (bottom, left) of the figure or axes.

examples/text_labels_and_annotations/text_alignment.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
Precise text layout
44
===================
55
6-
You can precisely layout text in data or axes (0,1) coordinates. This
7-
example shows you some of the alignment and rotation specifications for text
8-
layout.
6+
You can precisely layout text in data or axes coordinates. This example shows
7+
you some of the alignment and rotation specifications for text layout.
98
"""
109

1110
import matplotlib.pyplot as plt

examples/text_labels_and_annotations/text_rotation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
99
The text is aligned by its bounding box (the rectangular box that surrounds the
1010
ink rectangle). The order of operations is rotation then alignment.
11-
Basically, the text is centered at your x,y location, rotated around this
11+
Basically, the text is centered at your (x, y) location, rotated around this
1212
point, and then aligned according to the bounding box of the rotated text.
1313
1414
So if you specify left, bottom alignment, the bottom left of the
15-
bounding box of the rotated text will be at the x,y coordinate of the
16-
text.
15+
bounding box of the rotated text will be at the (x, y) coordinate of the text.
1716
1817
But a picture is worth a thousand words!
1918
"""

0 commit comments

Comments
 (0)
0