@@ -104,8 +104,8 @@ def __call__(self, legend, orig_handle,
104
104
fontsize )
105
105
106
106
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 ())
109
109
110
110
# create_artists will return a list of artists.
111
111
for a in a_list :
@@ -170,7 +170,8 @@ class HandlerLine2D(HandlerNpoints):
170
170
Handler for Line2D instances
171
171
"""
172
172
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 )
174
175
175
176
def create_artists (self , legend , orig_handle ,
176
177
xdescent , ydescent , width , height , fontsize ,
@@ -202,6 +203,7 @@ def create_artists(self, legend, orig_handle,
202
203
203
204
return [legline , legline_marker ]
204
205
206
+
205
207
class HandlerPatch (HandlerBase ):
206
208
"""
207
209
Handler for Patches
@@ -249,7 +251,7 @@ def _default_update_prop(self, legend_handle, orig_handle):
249
251
color = orig_handle .get_colors ()[0 ]
250
252
legend_handle .set_color (color )
251
253
legend_handle .set_linewidth (lw )
252
- if dashes [0 ] is not None : # dashed line
254
+ if dashes [0 ] is not None : # dashed line
253
255
legend_handle .set_dashes (dashes [1 ])
254
256
255
257
def create_artists (self , legend , orig_handle ,
@@ -373,10 +375,12 @@ def __init__(self, xerr_size=0.5, yerr_size=None,
373
375
self ._xerr_size = xerr_size
374
376
self ._yerr_size = yerr_size
375
377
376
- HandlerLine2D .__init__ (self , marker_pad = marker_pad , numpoints = numpoints ,
378
+ HandlerLine2D .__init__ (self , marker_pad = marker_pad ,
379
+ numpoints = numpoints ,
377
380
** kw )
378
381
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 ):
380
384
xerr_size = self ._xerr_size * fontsize
381
385
382
386
if self ._yerr_size is None :
@@ -398,7 +402,6 @@ def create_artists(self, legend, orig_handle,
398
402
ydata = ((height - ydescent ) / 2. ) * np .ones (xdata .shape , float )
399
403
legline = Line2D (xdata , ydata )
400
404
401
-
402
405
xdata_marker = np .asarray (xdata_marker )
403
406
ydata_marker = np .asarray (ydata [:len (xdata_marker )])
404
407
@@ -429,7 +432,7 @@ def create_artists(self, legend, orig_handle,
429
432
handle_caplines = []
430
433
431
434
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 ))
433
436
for x , y in zip (xdata_marker , ydata_marker )]
434
437
coll = mcoll .LineCollection (verts )
435
438
self .update_prop (coll , barlinecols [0 ], legend )
@@ -447,7 +450,7 @@ def create_artists(self, legend, orig_handle,
447
450
handle_caplines .append (capline_right )
448
451
449
452
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 ))
451
454
for x , y in zip (xdata_marker , ydata_marker )]
452
455
coll = mcoll .LineCollection (verts )
453
456
self .update_prop (coll , barlinecols [0 ], legend )
@@ -470,12 +473,12 @@ def create_artists(self, legend, orig_handle,
470
473
artists .extend (handle_caplines )
471
474
artists .append (legline )
472
475
473
-
474
476
for artist in artists :
475
477
artist .set_transform (trans )
476
478
477
479
return artists
478
480
481
+
479
482
class HandlerStem (HandlerNpointsYoffsets ):
480
483
"""
481
484
Handler for Errorbars
0 commit comments