@@ -902,7 +902,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
902
902
self .autoscale_view (scaley = False )
903
903
return p
904
904
905
- @unpack_labeled_data (replace_names = ['y' , 'xmin' , 'xmax' ])
905
+ @unpack_labeled_data (replace_names = ['y' , 'xmin' , 'xmax' ], label_namer = "y" )
906
906
@docstring .dedent
907
907
def hlines (self , y , xmin , xmax , colors = 'k' , linestyles = 'solid' ,
908
908
label = '' , ** kwargs ):
@@ -2251,7 +2251,7 @@ def barh(self, bottom, width, height=0.8, left=None, **kwargs):
2251
2251
bottom = bottom , orientation = 'horizontal' , ** kwargs )
2252
2252
return patches
2253
2253
2254
- # @unpack_labeled_data() # not df["name"] getable...
2254
+ @unpack_labeled_data (label_namer = None )
2255
2255
@docstring .dedent_interpd
2256
2256
def broken_barh (self , xranges , yrange , ** kwargs ):
2257
2257
"""
@@ -3661,7 +3661,8 @@ def dopatch(xs, ys, **kwargs):
3661
3661
medians = medians , fliers = fliers , means = means )
3662
3662
3663
3663
@unpack_labeled_data (replace_names = ["x" , "y" , "s" , "c" , "linewidths" , "edgecolors" ,
3664
- 'facecolor' ]) # alias for c
3664
+ 'facecolor' , 'facecolors' , 'color' ], # alias for c
3665
+ label_namer = "y" )
3665
3666
@docstring .dedent_interpd
3666
3667
def scatter (self , x , y , s = 20 , c = None , marker = 'o' , cmap = None , norm = None ,
3667
3668
vmin = None , vmax = None , alpha = None , linewidths = None ,
@@ -3869,7 +3870,7 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
3869
3870
3870
3871
return collection
3871
3872
3872
- @unpack_labeled_data (replace_names = ["x" , "y" ])
3873
+ @unpack_labeled_data (replace_names = ["x" , "y" ], label_namer = "y" )
3873
3874
@docstring .dedent_interpd
3874
3875
def hexbin (self , x , y , C = None , gridsize = 100 , bins = None ,
3875
3876
xscale = 'linear' , yscale = 'linear' , extent = None ,
@@ -4386,7 +4387,7 @@ def stackplot(self, x, *args, **kwargs):
4386
4387
return mstack .stackplot (self , x , * args , ** kwargs )
4387
4388
stackplot .__doc__ = mstack .stackplot .__doc__
4388
4389
4389
- # @unpack_labeled_data() # doesn't really work, as x and y have different shapes
4390
+ @unpack_labeled_data (replace_names = [ "x" , "y" , "u" , "v" , "start_points" ], label_namer = None )
4390
4391
def streamplot (self , x , y , u , v , density = 1 , linewidth = None , color = None ,
4391
4392
cmap = None , norm = None , arrowsize = 1 , arrowstyle = '-|>' ,
4392
4393
minlength = 0.1 , transform = None , zorder = 1 , start_points = None ):
@@ -4756,7 +4757,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
4756
4757
return collection
4757
4758
4758
4759
#### plotting z(x,y): imshow, pcolor and relatives, contour
4759
- # @unpack_labeled_data() # nothing which could be in an DataFrame
4760
+ @unpack_labeled_data (label_namer = None )
4760
4761
@docstring .dedent_interpd
4761
4762
def imshow (self , X , cmap = None , norm = None , aspect = None ,
4762
4763
interpolation = None , alpha = None , vmin = None , vmax = None ,
@@ -4961,7 +4962,7 @@ def _pcolorargs(funcname, *args, **kw):
4961
4962
C = C [:Ny - 1 , :Nx - 1 ]
4962
4963
return X , Y , C
4963
4964
4964
- # @unpack_labeled_data() # 2d data can't be df["name"]'ed
4965
+ @unpack_labeled_data (label_namer = None )
4965
4966
@docstring .dedent_interpd
4966
4967
def pcolor (self , * args , ** kwargs ):
4967
4968
"""
@@ -5238,7 +5239,7 @@ def pcolor(self, *args, **kwargs):
5238
5239
self .add_collection (collection , autolim = False )
5239
5240
return collection
5240
5241
5241
- # @unpack_labeled_data() # 2d data can't be df["name"]'ed
5242
+ @unpack_labeled_data (label_namer = None )
5242
5243
@docstring .dedent_interpd
5243
5244
def pcolormesh (self , * args , ** kwargs ):
5244
5245
"""
@@ -5387,7 +5388,7 @@ def pcolormesh(self, *args, **kwargs):
5387
5388
self .add_collection (collection , autolim = False )
5388
5389
return collection
5389
5390
5390
- # @unpack_labeled_data() #2d data can't be df["name"]'ed
5391
+ @unpack_labeled_data (label_namer = None )
5391
5392
@docstring .dedent_interpd
5392
5393
def pcolorfast (self , * args , ** kwargs ):
5393
5394
"""
0 commit comments