@@ -633,8 +633,8 @@ def labels(self, inline, inline_spacing):
633
633
add_label = self .add_label
634
634
635
635
for icon , lev , fsize , cvalue in zip (
636
- self .labelIndiceList , self .labelLevelList , self . labelFontSizeList ,
637
- self .labelCValueList ):
636
+ self .labelIndiceList , self .labelLevelList ,
637
+ self . labelFontSizeList , self .labelCValueList ):
638
638
639
639
con = self .collections [icon ]
640
640
trans = con .get_transform ()
@@ -902,12 +902,13 @@ def __init__(self, ax, *args, **kwargs):
902
902
paths = self ._make_paths (segs , kinds )
903
903
# Default zorder taken from Collection
904
904
zorder = kwargs .get ('zorder' , 1 )
905
- col = mcoll .PathCollection (paths ,
906
- antialiaseds = (self .antialiased ,),
907
- edgecolors = 'none' ,
908
- alpha = self .alpha ,
909
- transform = self .get_transform (),
910
- zorder = zorder )
905
+ col = mcoll .PathCollection (
906
+ paths ,
907
+ antialiaseds = (self .antialiased ,),
908
+ edgecolors = 'none' ,
909
+ alpha = self .alpha ,
910
+ transform = self .get_transform (),
911
+ zorder = zorder )
911
912
self .ax .add_collection (col )
912
913
self .collections .append (col )
913
914
else :
@@ -921,13 +922,14 @@ def __init__(self, ax, *args, **kwargs):
921
922
zip (self .levels , tlinewidths , tlinestyles , self .allsegs ):
922
923
# Default zorder taken from LineCollection
923
924
zorder = kwargs .get ('zorder' , 2 )
924
- col = mcoll .LineCollection (segs ,
925
- antialiaseds = aa ,
926
- linewidths = width ,
927
- linestyle = [lstyle ],
928
- alpha = self .alpha ,
929
- transform = self .get_transform (),
930
- zorder = zorder )
925
+ col = mcoll .LineCollection (
926
+ segs ,
927
+ antialiaseds = aa ,
928
+ linewidths = width ,
929
+ linestyle = [lstyle ],
930
+ alpha = self .alpha ,
931
+ transform = self .get_transform (),
932
+ zorder = zorder )
931
933
col .set_label ('_nolegend_' )
932
934
self .ax .add_collection (col , False )
933
935
self .collections .append (col )
@@ -972,29 +974,27 @@ def legend_elements(self, variable_name='x', str_format=str):
972
974
n_levels = len (self .collections )
973
975
974
976
for i , (collection , lower , upper ) in enumerate (
975
- zip (self .collections ,
976
- lowers , uppers )):
977
- patch = mpatches .Rectangle (
978
- (0 , 0 ), 1 , 1 ,
979
- facecolor = collection .get_facecolor ()[0 ],
980
- hatch = collection .get_hatch (),
981
- alpha = collection .get_alpha (),
982
- )
983
- artists .append (patch )
984
-
985
- lower = str_format (lower )
986
- upper = str_format (upper )
987
-
988
- if i == 0 and self .extend in ('min' , 'both' ):
989
- labels .append (r'$%s \leq %s$' % (variable_name ,
990
- lower ))
991
- elif i == n_levels - 1 and self .extend in ('max' , 'both' ):
992
- labels .append (r'$%s > %s$' % (variable_name ,
993
- upper ))
994
- else :
995
- labels .append (r'$%s < %s \leq %s$' % (lower ,
996
- variable_name ,
997
- upper ))
977
+ zip (self .collections , lowers , uppers )):
978
+ patch = mpatches .Rectangle (
979
+ (0 , 0 ), 1 , 1 ,
980
+ facecolor = collection .get_facecolor ()[0 ],
981
+ hatch = collection .get_hatch (),
982
+ alpha = collection .get_alpha ())
983
+ artists .append (patch )
984
+
985
+ lower = str_format (lower )
986
+ upper = str_format (upper )
987
+
988
+ if i == 0 and self .extend in ('min' , 'both' ):
989
+ labels .append (r'$%s \leq %s$' % (variable_name ,
990
+ lower ))
991
+ elif i == n_levels - 1 and self .extend in ('max' , 'both' ):
992
+ labels .append (r'$%s > %s$' % (variable_name ,
993
+ upper ))
994
+ else :
995
+ labels .append (r'$%s < %s \leq %s$' % (lower ,
996
+ variable_name ,
997
+ upper ))
998
998
else :
999
999
for collection , level in zip (self .collections , self .levels ):
1000
1000
@@ -1033,7 +1033,7 @@ def _process_args(self, *args, **kwargs):
1033
1033
1034
1034
# Check length of allkinds.
1035
1035
if (self .allkinds is not None and
1036
- len (self .allkinds ) != len (self .allsegs )):
1036
+ len (self .allkinds ) != len (self .allsegs )):
1037
1037
raise ValueError ('allkinds has different length to allsegs' )
1038
1038
1039
1039
# Determine x,y bounds and update axes data limits.
@@ -1411,7 +1411,7 @@ def _process_args(self, *args, **kwargs):
1411
1411
# if the transform is not trans data, and some part of it
1412
1412
# contains transData, transform the xs and ys to data coordinates
1413
1413
if (t != self .ax .transData and
1414
- any (t .contains_branch_seperately (self .ax .transData ))):
1414
+ any (t .contains_branch_seperately (self .ax .transData ))):
1415
1415
trans_to_data = t - self .ax .transData
1416
1416
pts = (np .vstack ([x .flat , y .flat ]).T )
1417
1417
transformed_pts = trans_to_data .transform (pts )
@@ -1521,11 +1521,11 @@ def _check_xyz(self, args, kwargs):
1521
1521
1522
1522
if x .shape != z .shape :
1523
1523
raise TypeError ("Shape of x does not match that of z: found "
1524
- "{0} instead of {1}." .format (x .shape , z .shape ))
1524
+ "{0} instead of {1}." .format (x .shape , z .shape ))
1525
1525
1526
1526
if y .shape != z .shape :
1527
1527
raise TypeError ("Shape of y does not match that of z: found "
1528
- "{0} instead of {1}." .format (y .shape , z .shape ))
1528
+ "{0} instead of {1}." .format (y .shape , z .shape ))
1529
1529
1530
1530
else :
1531
1531
0 commit comments