8000 pep8 fixes · matplotlib/matplotlib@bcb2f11 · GitHub
[go: up one dir, main page]

Skip to content

Commit bcb2f11

Browse files
committed
pep8 fixes
1 parent e2c62d2 commit bcb2f11

Fi 8000 le tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

examples/pylab_examples/markevery_demo.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
(0.0, 0.1), (0.45, 0.1)]
3232

3333
#define the figure size and grid layout properties
34-
figsize = (10,8)
34+
figsize = (10, 8)
3535
cols = 3
3636
gs = gridspec.GridSpec(len(cases) // cols + 1, cols)
3737

@@ -42,41 +42,41 @@
4242

4343
#plot each markevery case for linear x and y scales
4444
fig1 = plt.figure(num=1, figsize=figsize)
45-
ax=[]
45+
ax = []
4646
for i, case in enumerate(cases):
4747
row = (i // cols)
4848
col = i % cols
49-
ax.append(fig1.add_subplot(gs[row,col]))
49+
ax.append(fig1.add_subplot(gs[row, col]))
5050
ax[-1].set_title('markevery=%s' % str(case))
51-
ax[-1].plot(x, y,'o', ls='-', ms=4, markevery=case)
51+
ax[-1].plot(x, y, 'o', ls='-', ms=4, markevery=case)
5252
#fig1.tight_layout()
5353

5454
#plot each markevery case for log x and y scales
5555
fig2 = plt.figure(num=2, figsize=figsize)
56-
axlog=[]
56+
axlog = []
5757
for i, case in enumerate(cases):
5858
row = (i // cols)
5959
col = i % cols
60-
axlog.append(fig2.add_subplot(gs[row,col]))
60+
axlog.append(fig2.add_subplot(gs[row, col]))
6161
axlog[-1].set_title('markevery=%s' % str(case))
6262
axlog[-1].set_xscale('log')
6363
axlog[-1].set_yscale('log')
64-
axlog[-1].plot(x, y,'o', ls='-', ms=4, markevery=case)
64+
axlog[-1].plot(x, y, 'o', ls='-', ms=4, markevery=case)
6565
fig2.tight_layout()
6666

6767
#plot each markevery case for linear x and y scales but zoomed in
6868
#note the behaviour when zoomed in. When a start marker offset is specified
6969
#it is always interpreted with respect to the first data point which might be
7070
#different to th 8000 e first visible data point.
7171
fig3 = plt.figure(num=3, figsize=figsize)
72-
axzoom=[]
72+
axzoom = []
7373
for i, case in enumerate(cases):
7474
row = (i // cols)
7575
col = i % cols
76-
axzoom.append(fig3.add_subplot(gs[row,col]))
76+
axzoom.append(fig3.add_subplot(gs[row, col]))
7777
axzoom[-1].set_title('markevery=%s' % str(case))
78-
axzoom[-1].plot(x, y,'o', ls='-', ms=4, markevery=case)
79-
axzoom[-1].set_xlim((6,6.7))
78+
axzoom[-1].plot(x, y, 'o', ls='-', ms=4, markevery=case)
79+
axzoom[-1].set_xlim((6, 6.7))
8080
axzoom[-1].set_ylim((1.1, 1.7))
8181
fig3.tight_layout()
8282

@@ -86,13 +86,13 @@
8686

8787
#plot each markevery case for polar plots
8888
fig4 = plt.figure(num=4, figsize=figsize)
89-
axpolar=[]
89+
axpolar = []
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))
95-
axpolar[-1].plot(theta, r,'o', ls='-', ms=4, markevery=case)
95+
axpolar[-1].plot(theta, r, 'o', ls='-', ms=4, markevery=case)
9696
fig4.tight_layout()
9797

9898
plt.show()

lib/matplotlib/lines.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ def draw(self, renderer):
634634
#calc cumulative distance along path (in display
635635
# coords):
636636
disp_coords = affine.transform(tpath.vertices)
637-
delta = np.empty((len(disp_coords), 2), dtype=float)
637+
delta = np.empty((len(disp_coords), 2),
638+
dtype=float)
638639
delta[0, :] = 0.0
639640
delta[1:, :] = (disp_coords[1:, :] -
640641
disp_coords[:-1, :])
@@ -644,11 +645,14 @@ def draw(self, renderer):
644645
#calc distance between markers along path based on
645646
# the axes bounding box diagonal being a distance
646647
# of unity:
647-
scale = self.axes.transAxes.transform(np.array([[0,0],[1,1]]))
648+
scale = self.axes.transAxes.transform(
649+
np.array([[0, 0], [1, 1]]))
648650
scale = np.diff(scale, axis=0)
649651
scale = np.sum(scale**2)
650652
scale = np.sqrt(scale)
651-
marker_delta = np.arange(start * scale, delta[-1], step * scale)
653+
marker_delta = np.arange(start * scale,
654+
delta[-1],
655+
step * scale)
652656
#find closest actual data point that is closest to
653657
# the theoretical distance along the path:
654658
inds = np.abs(delta[np.newaxis, :] -

lib/matplotlib/tests/test_axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,11 @@ def test_markevery_linear_scales():
864864
y = np.sin(x) + 1.0 + delta
865865

866866
fig = plt.figure()
867-
ax=[]
867+
ax = []
868868
for i, case in enumerate(cases):
869869
row = (i // cols)
870870
col = i % cols
871-
ax.append(fig.add_subplot(gs[row,col]))
871+
ax.append(fig.add_subplot(gs[row, col]))
872872
ax[-1].set_title('markevery=%s' % str(case))
873873
ax[-1].plot(x, y, 'o', ls='-', ms=4, markevery=case)
874874

@@ -891,7 +891,7 @@ def test_markevery_linear_scales_zoomed():
891891
y = np.sin(x) + 1.0 + delta
892892

893893
fig = plt.figure()
894-
ax=[]
894+
ax = []
895895
for i, case in enumerate(cases):
896896
row = (i // cols)
897897
col = i % cols
@@ -921,7 +921,7 @@ def test_markevery_log_scales():
921921
y = np.sin(x) + 1.0 + delta
922922

923923
fig = plt.figure()
924-
ax=[]
924+
ax = []
925925
for i, case in enumerate(cases):
926926
row = (i // cols)
927927
col = i % cols
@@ -949,7 +949,7 @@ def test_markevery_polar():
949949
theta = 2 * np.pi * r
950950

951951
fig = plt.figure()
952-
ax=[]
952+
ax = []
953953
for i, case in enumerate(cases):
954954
row = (i // cols)
955955
col = i % cols

0 commit comments

Comments
 (0)
0