Skip to content

Commit 6caa4ac

Browse files
committed
pep8 fixes
1 parent 7f53d65 commit 6caa4ac

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

lib/matplotlib/legend_handler.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def __call__(self, legend, orig_handle,
104104
fontsize)
105105

106106
a_list = self.create_artists(legend, orig_handle,
107-
xdescent, ydescent, width, height, fontsize,
108-
handlebox.get_transform())
107+
xdescent, ydescent, width, height,
108+
fontsize, handlebox.get_transform())
109109

110110
# create_artists will return a list of artists.
111111
for a in a_list:
@@ -170,7 +170,8 @@ class HandlerLine2D(HandlerNpoints):
170170
Handler for Line2D instances
171171
"""
172172
def __init__(self, marker_pad=0.3, numpoints=None, **kw):
173-
HandlerNpoints.__init__(self, marker_pad=marker_pad, numpoints=numpoints, **kw)
173+
HandlerNpoints.__init__(self, marker_pad=marker_pad,
174+
numpoints=numpoints, **kw)
174175

175176
def create_artists(self, legend, orig_handle,
176177
xdescent, ydescent, width, height, fontsize,
@@ -202,6 +203,7 @@ def create_artists(self, legend, orig_handle,
202203

203204
return [legline, legline_marker]
204205

206+
205207
class HandlerPatch(HandlerBase):
206208
"""
207209
Handler for Patches
@@ -249,7 +251,7 @@ def _default_update_prop(self, legend_handle, orig_handle):
249251
color = orig_handle.get_colors()[0]
250252
legend_handle.set_color(color)
251253
legend_handle.set_linewidth(lw)
252-
if dashes[0] is not None: # dashed line
254+
if dashes[0] is not None: # dashed line
253255
legend_handle.set_dashes(dashes[1])
254256

255257
def create_artists(self, legend, orig_handle,
@@ -373,10 +375,12 @@ def __init__(self, xerr_size=0.5, yerr_size=None,
373375
self._xerr_size = xerr_size
374376
self._yerr_size = yerr_size
375377

376-
HandlerLine2D.__init__(self, marker_pad=marker_pad, numpoints=numpoints,
378+
HandlerLine2D.__init__(self, marker_pad=marker_pad,
379+
numpoints=numpoints,
377380
**kw)
378381

379-
def get_err_size(self, legend, xdescent, ydescent, width, height, fontsize):
382+
def get_err_size(self, legend, xdescent,
383+
ydescent, width, height, fontsize):
380384
xerr_size = self._xerr_size * fontsize
381385

382386
if self._yerr_size is None:
@@ -398,7 +402,6 @@ def create_artists(self, legend, orig_handle,
398402
ydata = ((height - ydescent) / 2.) * np.ones(xdata.shape, float)
399403
legline = Line2D(xdata, ydata)
400404

401-
402405
xdata_marker = np.asarray(xdata_marker)
403406
ydata_marker = np.asarray(ydata[:len(xdata_marker)])
404407

@@ -429,7 +432,7 @@ def create_artists(self, legend, orig_handle,
429432
handle_caplines = []
430433

431434
if orig_handle.has_xerr:
432-
verts = [ ((x - xerr_size, y), (x + xerr_size, y))
435+
verts = [((x - xerr_size, y), (x + xerr_size, y))
433436
for x, y in zip(xdata_marker, ydata_marker)]
434437
coll = mcoll.LineCollection(verts)
435438
self.update_prop(coll, barlinecols[0], legend)
@@ -447,7 +450,7 @@ def create_artists(self, legend, orig_handle,
447450
handle_caplines.append(capline_right)
448451

449452
if orig_handle.has_yerr:
450-
verts = [ ((x, y - yerr_size), (x, y + yerr_size))
453+
verts = [((x, y - yerr_size), (x, y + yerr_size))
451454
for x, y in zip(xdata_marker, ydata_marker)]
452455
coll = mcoll.LineCollection(verts)
453456
self.update_prop(coll, barlinecols[0], legend)
@@ -470,12 +473,12 @@ def create_artists(self, legend, orig_handle,
470473
artists.extend(handle_caplines)
471474
artists.append(legline)
472475

473-
474476
for artist in artists:
475477
artist.set_transform(trans)
476478

477479
return artists
478480

481+
479482
class HandlerStem(HandlerNpointsYoffsets):
480483
"""
481484
Handler for Errorbars

lib/matplotlib/tests/test_coding_standards.py

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
'*/matplotlib/fontconfig_pattern.py',
5555
'*/matplotlib/gridspec.py',
5656
'*/matplotlib/legend.py',
57-
'*/matplotlib/legend_handler.py',
5857
'*/matplotlib/mathtext.py',
5958
'*/matplotlib/mlab.py',
6059
'*/matplotlib/path.py',

0 commit comments

Comments
 (0)