8000 fix E251 · matplotlib/matplotlib@4c21181 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c21181

Browse files
committed
fix E251
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
1 parent dbeed94 commit 4c21181

28 files changed

+106
-106
lines changed

examples/images_contours_and_fields/interpolation_none_vs_nearest.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@
2323
[0.6, 0.3, 0.0, 0.2], [0.7, 0.9, 0.4, 0.6]])
2424

2525
#Create a 2x2 table of plots
26-
fig = plt.figure(figsize = [8.0, 7.5])
26+
fig = plt.figure(figsize=[8.0, 7.5])
2727
ax = plt.subplot(2,2,1)
28-
ax.imshow(big_im, interpolation = 'none')
28+
ax.imshow(big_im, interpolation='none')
2929
ax = plt.subplot(2,2,2)
30-
ax.imshow(big_im, interpolation = 'nearest')
30+
ax.imshow(big_im, interpolation='nearest')
3131
ax = plt.subplot(2,2,3)
32-
ax.imshow(small_im, interpolation = 'none')
32+
ax.imshow(small_im, interpolation='none')
3333
ax = plt.subplot(2,2,4)
34-
ax.imshow(small_im, interpolation = 'nearest')
35-
plt.subplots_adjust(left = 0.24, wspace = 0.2, hspace = 0.1, \
36-
bottom = 0.05, top = 0.86)
34+
ax.imshow(small_im, interpolation='nearest')
35+
plt.subplots_adjust(left=0.24, wspace=0.2, hspace=0.1, \
36+
bottom=0.05, top=0.86)
3737

3838
#Label the rows and columns of the table
39-
fig.text(0.03, 0.645, 'Big Image\nScaled Down', ha = 'left')
40-
fig.text(0.03, 0.225, 'Small Image\nBlown Up', ha = 'left')
41-
fig.text(0.383, 0.90, "Interpolation = 'none'", ha = 'center')
42-
fig.text(0.75, 0.90, "Interpolation = 'nearest'", ha = 'center')
39+
fig.text(0.03, 0.645, 'Big Image\nScaled Down', ha='left')
40+
fig.text(0.03, 0.225, 'Small Image\nBlown Up', ha='left')
41+
fig.text(0.383, 0.90, "Interpolation = 'none'", ha='center')
42+
fig.text(0.75, 0.90, "Interpolation = 'nearest'", ha='center')
4343

4444
#If you were going to run this example on your local machine, you
4545
#would save the figure as a PNG, save the same figure as a PDF, and
4646
#then compare them. The following code would suffice.
47-
txt = fig.text(0.452, 0.95, 'Saved as a PNG', fontsize = 18)
47+
txt = fig.text(0.452, 0.95, 'Saved as a PNG', fontsize=18)
4848
# plt.savefig('None_vs_nearest-png.png')
4949
# txt.set_text('Saved as a PDF')
5050
# plt.savefig('None_vs_nearest-pdf.pdf')
@@ -56,7 +56,7 @@
5656
#display it.
5757
pdf_im_path = cbook.get_sample_data('None_vs_nearest-pdf.png')
5858
pdf_im = plt.imread(pdf_im_path)
59-
fig2 = plt.figure(figsize = [8.0, 7.5])
59+
fig2 = plt.figure(figsize=[8.0, 7.5])
6060
plt.figimage(pdf_im)
6161

6262
plt.show()

examples/misc/multiprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class NBPlot(object):
6464
def __init__(self):
6565
self.plot_pipe, plotter_pipe = Pipe()
6666
self.plotter = ProcessPlotter()
67-
self.plot_process = Process(target = self.plotter,
68-
args = (plotter_pipe,))
67+
self.plot_process = Process(target=self.plotter,
68+
args=(plotter_pipe,))
6969
self.plot_process.daemon = True
7070
self.plot_process.start()
7171

examples/misc/rc_traits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def __init__(self,
170170
edgecolor=None,
171171
facecolor=None,
172172
linewidth=None,
173-
antialiased = None,
173+
antialiased=None,
174174
fill=1,
175175
**kwargs
176176
):

examples/mplot3d/polys3d_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ys[0], ys[-1] = 0, 0
1818
verts.append(list(zip(xs, ys)))
1919

20-
poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
20+
poly = PolyCollection(verts, facecolors=[cc('r'), cc('g'), cc('b'),
2121
cc('y')])
2222
poly.set_alpha(0.7)
2323
ax.add_collection3d(poly, zs=zs, zdir='y')

examples/pylab_examples/arrow_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def add_dicts(d1, d2):
2525

2626

2727
def make_arrow_plot(data, size=4, display='length', shape='right', \
28-
max_arrow_width=0.03, arrow_sep = 0.02, alpha=0.5, \
28+
max_arrow_width=0.03, arrow_sep=0.02, alpha=0.5, \
2929
normalize_data=False, ec=None, labelcolor=None, \
3030
head_starts_at_zero=True, rate_labels=lettered_bases_to_rates,\
3131
**kwargs):

examples/pylab_examples/contour_image.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# of the polygons in the collections returned by contourf.
4848
# Use levels output from previous call to guarantee they are the same.
4949
cset2 = contour(X, Y, Z, cset1.levels,
50-
colors = 'k',
50+
colors='k',
5151
hold='on')
5252
# We don't really need dashed contour lines to indicate negative
5353
# regions, so let's turn them off.
@@ -59,8 +59,8 @@
5959
# We are making a thick green line as a zero contour.
6060
# Specify the zero level as a tuple with only 0 in it.
6161
cset3 = contour(X, Y, Z, (0,),
62-
colors = 'g',
63-
linewidths = 2,
62+
colors='g',
63+
linewidths=2,
6464
hold='on')
6565
title('Filled contours')
6666
colorbar(cset1)
@@ -71,7 +71,7 @@
7171

7272
imshow(Z, extent=extent, cmap=cmap, norm=norm)
7373
v = axis()
74-
contour(Z, levels, hold='on', colors = 'k',
74+
contour(Z, levels, hold='on', colors='k',
7575
origin='upper', extent=extent)
7676
axis(v)
7777
title("Image, origin 'upper'")
@@ -80,7 +80,7 @@
8080

8181
imshow(Z, origin='lower', extent=extent, cmap=cmap, norm=norm)
8282
v = axis()
83-
contour(Z, levels, hold='on', colors = 'k',
83+
contour(Z, levels, hold='on', colors='k',
8484
origin='lower', extent=extent)
8585
axis(v)
8686
title("Image, origin 'lower'")
@@ -95,7 +95,7 @@
9595
# domain that is contoured does not extend beyond these pixel centers.
9696
im = imshow(Z, interpolation='nearest', extent=extent, cmap=cmap, norm=norm)
9797
v = axis()
98-
contour(Z, levels, hold='on', colors = 'k',
98+
contour(Z, levels, hold='on', colors='k',
9999
origin='image', extent=extent)
100100
axis(v)
101101
ylim = get(gca(), 'ylim')

examples/pylab_examples/contourf_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# or leave out the levels kwarg to use all of the original levels.
4545

4646
CS2 = plt.contour(CS, levels=CS.levels[::2],
47-
colors = 'r',
47+
colors='r',
4848
origin=origin,
4949
hold='on')
5050

@@ -65,7 +65,7 @@
6565
# of colors.
6666
levels = [-1.5, -1, -0.5, 0, 0.5, 1]
6767
CS3 = plt.contourf(X, Y, Z, levels,
68-
colors = ('r', 'g', 'b'),
68+
colors=('r', 'g', 'b'),
6969
origin=origin,
7070
extend='both')
7171
# Our data range extends outside the range of levels; make
@@ -75,11 +75,11 @@
7575
CS3.cmap.set_over('cyan')
7676

7777
CS4 = plt.contour(X, Y, Z, levels,
78-
colors = ('k',),
78+
colors=('k',),
7979
linewidths = (3,),
8080
origin = origin)
8181
plt.title('Listed colors (3 masked regions)')
82-
plt.clabel(CS4, fmt = '%2.1f', colors = 10000 'w', fontsize=14)
82+
plt.clabel(CS4, fmt='%2.1f', colors='w', fontsize=14)
8383

8484
# Notice that the colorbar command gets all the information it
8585
# needs from the ContourSet object, CS3.

examples/pylab_examples/demo_bboximage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
kwargs = dict()
1313

1414
bbox_image = BboxImage(txt.get_window_extent,
15-
norm = None,
15+
norm=None,
1616
origin=None,
1717
clip_on=False,
1818
**kwargs
@@ -48,8 +48,8 @@
4848
bbox = TransformedBbox(bbox0, ax.transAxes)
4949

5050
bbox_image = BboxImage(bbox,
51-
cmap = plt.get_cmap(m),
52-
norm = None,
51+
cmap=plt.get_cmap(m),
52+
norm=None,
5353
origin=None,
5454
**kwargs
5555
)

examples/pylab_examples/demo_ribbon_box.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,24 @@ class RibbonBoxImage(BboxImage):
5151
zorder = 1
5252

5353
def __init__(self, bbox, color,
54-
cmap = None,
55-
norm = None,
54+
cmap=None,
55+
norm=None,
5656
interpolation=None,
5757
origin=None,
5858
filternorm=1,
5959
filterrad=4.0,
60-
resample = False,
60+
resample=False,
6161
**kwargs
6262
):
6363

6464
BboxImage.__init__(self, bbox,
65-
cmap = cmap,
66-
norm = norm,
65+
cmap=cmap,
66+
norm=norm,
6767
interpolation=interpolation,
6868
origin=origin,
6969
filternorm=filternorm,
7070
filterrad=filterrad,
71-
resample = resample,
71+
resample=resample,
7272
**kwargs
7373
)
7474

examples/pylab_examples/demo_text_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def set_facecolor(self, color):
3535
def _init_bbox_image(self, im):
3636

3737
bbox_image = BboxImage(self.get_window_extent,
38-
norm = None,
38+
norm=None,
3939
origin=None,
4040
)
4141
bbox_image.set_transform(IdentityTransform())

examples/pylab_examples/fancytextbox_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
plt.text(0.6, 0.5, "test", size=50, rotation=30.,
44
ha="center", va="center",
5-
bbox = dict(boxstyle="round",
5+
bbox=dict(boxstyle="round",
66
ec=(1., 0.5, 0.5),
77
fc=(1., 0.8, 0.8),
88
)
99
)
1010

1111
plt.text(0.5, 0.4, "test", size=50, rotation=-30.,
1212
ha="right", va="top",
13-
bbox = dict(boxstyle="square",
13+
bbox=dict(boxstyle="square",
1414
ec=(1., 0.5, 0.5),
1515
fc=(1., 0.8, 0.8),
1616
)

examples/pylab_examples/fonts_demo_kw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
**alignment)
7373

7474
t = text(x, 0.2, 'bold italic',
75-
style = 'italic', weight='bold', size='medium',
75+
style='italic', weight='bold', size='medium',
7676
**alignment)
7777

7878
t = text(x, 0.3, 'bold italic',

examples/pylab_examples/image_masked.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@
3636
subplot(1,2,1)
3737
im = imshow(Zm, interpolation='bilinear',
3838
cmap=palette,
39-
norm = colors.Normalize(vmin = -1.0, vmax = 1.0, clip = False),
39+
norm=colors.Normalize(vmin=-1.0, vmax=1.0, clip=False),
4040
origin='lower', extent=[-3,3,-3,3])
4141
title('Green=low, Red=high, Blue=bad')
4242
colorbar(im, extend='both', orientation='horizontal', shrink=0.8)
4343

4444
subplot(1,2,2)
4545
im = imshow(Zm, interpolation='nearest',
4646
cmap=palette,
47-
norm = colors.BoundaryNorm([-1, -0.5, -0.2, 0, 0.2, 0.5, 1],
48-
ncolors=256, clip = False),
47+
norm=colors.BoundaryNorm([-1, -0.5, -0.2, 0, 0.2, 0.5, 1],
48+
ncolors=256, clip=False),
4949
origin='lower', extent=[-3,3,-3,3])
5050
title('With BoundaryNorm')
5151
colorbar(im, extend='both', spacing='proportional',

examples/pylab_examples/line_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# If linestyle is omitted, 'solid' is used
3232
# See matplotlib.collections.LineCollection for more information
3333
line_segments = LineCollection(segs,
34-
linewidths = (0.5,1,1.5,2),
34+
linewidths=(0.5,1,1.5,2),
3535
colors = [colorConverter.to_rgba(i) \
3636
for i in ('b','g','r','c','m','y','k')],
3737
linestyle = 'solid')

examples/pylab_examples/line_collection2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# If linestyle is omitted, 'solid' is used
2323
# See matplotlib.collections.LineCollection for more information
2424
line_segments = LineCollection([list(zip(x,y)) for y in ys], # Make a sequence of x,y pairs
25-
linewidths = (0.5,1,1.5,2),
25+
linewidths=(0.5,1,1.5,2),
2626
linestyles = 'solid')
2727
line_segments.set_array(x)
2828
ax.add_collection(line_segments)

examples/pylab_examples/logo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
fontsize=40, fontname='Courier',
2020
horizontalalignment='center',
2121
verticalalignment='center',
22-
transform = ax.transAxes,
22+
transform=ax.transAxes,
2323
)
2424
axis([1, 1.72,-60, 10])
2525
setp(gca(), 'xticklabels', [])

examples/pylab_examples/markevery_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
for i, case in enumerate(cases):
9191
row = (i // cols)
9292
col = i % cols
93-
axpolar.append(fig4.add_subplot(gs[row, col], polar = True))
93+
axpolar.append(fig4.add_subplot(gs[row, col], polar=True))
9494
axpolar[-1].set_title('markevery=%s' % str(case))
9595
axpolar[-1].plot(theta, r, 'o', ls='-', ms=4, markevery=case)
9696
fig4.tight_layout()

examples/pylab_examples/masked_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
ym2 = ma.masked_where(y2 < -0.5, y2)
1717

1818
lines = plot(x, y, 'r', x, ym1, 'g', x, ym2, 'bo')
19-
setp(lines[0], linewidth = 4)
20-
setp(lines[1], linewidth = 2)
21-
setp(lines[2], markersize = 10)
19+
setp(lines[0], linewidth=4)
20+
setp(lines[1], linewidth=2)
21+
setp(lines[2], markersize=10)
2222

2323
legend(('No mask', 'Masked if > 0.5', 'Masked if < -0.5') ,
24-
loc = 'upper right')
24+
loc='upper right')
2525
title('Masked line demo')
2626
show()

examples/pylab_examples/multiline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#ylabel('this is another!')
1414
text(2, 7,'this is\nyet another test',
1515
rotation=45,
16-
horizontalalignment = 'center',
17-
verticalalignment = 'top',
18-
multialignment = 'center')
16+
horizontalalignment='center',
17+
verticalalignment='top',
18+
multialignment='center')
1919

2020
grid(True)
2121

examples/pylab_examples/scatter_custom_symbol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
s*= 10**2.
1313

1414
fig, ax = plt.subplots()
15-
ax.scatter(x,y,s,c,marker=None,verts =verts)
15+
ax.scatter(x,y,s,c,marker=None,verts=verts)
1616

1717
plt.show()

examples/pylab_examples/transoffset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# first; the subplot command above is one way to do this.
3333

3434
transOffset = offset_copy(ax.transData, fig=fig,
35-
x = 0.05, y=0.10, units='inches')
35+
x=0.05, y=0.10, units='inches')
3636

3737
for x, y in zip(X, Y):
3838
P.plot((x,),(y,), 'ro')
@@ -43,7 +43,7 @@
4343

4444
ax = P.subplot(2,1,2, polar=True)
4545

46-
transOffset = offset_copy(ax.transData, fig=fig, y = 6, units='dots')
46+
transOffset = offset_copy(ax.transData, fig=fig, y=6, units='dots')
4747

4848
for x, y in zip(X, Y):
4949
P.polar((x,),(y,), 'ro')

0 commit comments

Comments
 (0)
0