@@ -981,7 +981,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
981
981
982
982
return coll
983
983
984
- @unpack_labeled_data ()
984
+ @unpack_labeled_data (replace_names = [ "x" , "ymin" , "ymax" , "colors" ], label_namer = "x" )
985
985
@docstring .dedent_interpd
986
986
def vlines (self , x , ymin , ymax , colors = 'k' , linestyles = 'solid' ,
987
987
label = '' , ** kwargs ):
@@ -1062,7 +1062,7 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
1062
1062
1063
1063
return coll
1064
1064
1065
- @unpack_labeled_data ()
1065
+ @unpack_labeled_data (replace_all_args = False , label_namer = None )
1066
1066
@docstring .dedent_interpd
1067
1067
def eventplot (self , positions , orientation = 'horizontal' , lineoffsets = 1 ,
1068
1068
linelengths = 1 , linewidths = None , colors = None ,
@@ -1245,7 +1245,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1245
1245
return colls
1246
1246
1247
1247
#### Basic plotting
1248
- @unpack_labeled_data ()
1248
+ @unpack_labeled_data (replace_all_args = True , label_namer = None )
1249
1249
@docstring .dedent_interpd
1250
1250
def plot (self , * args , ** kwargs ):
1251
1251
"""
@@ -1390,7 +1390,7 @@ def plot(self, *args, **kwargs):
1390
1390
self .autoscale_view (scalex = scalex , scaley = scaley )
1391
1391
return lines
1392
1392
1393
- @unpack_labeled_data ()
1393
+ @unpack_labeled_data (replace_names = [ "x" , "y" ], label_namer = "y" )
1394
1394
@docstring .dedent_interpd
1395
1395
def plot_date (self , x , y , fmt = 'o' , tz = None , xdate = True , ydate = False ,
1396
1396
** kwargs ):
@@ -1464,7 +1464,7 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
1464
1464
1465
1465
return ret
1466
1466
1467
- @unpack_labeled_data ()
1467
+ # @unpack_labeled_data() # let 'plot' do the unpacking..
1468
1468
@docstring .dedent_interpd
1469
1469
def loglog (self , * args , ** kwargs ):
1470
1470
"""
@@ -1526,7 +1526,7 @@ def loglog(self, *args, **kwargs):
1526
1526
1527
1527
return l
1528
1528
1529
- @unpack_labeled_data ()
1529
+ # @unpack_labeled_data() # let 'plot' do the unpacking..
1530
1530
@docstring .dedent_interpd
1531
1531
def semilogx (self , * args , ** kwargs ):
1532
1532
"""
@@ -1579,7 +1579,7 @@ def semilogx(self, *args, **kwargs):
1579
1579
self ._hold = b # restore the hold
1580
1580
return l
1581
1581
1582
- @unpack_labeled_data ()
1582
+ # @unpack_labeled_data() # let 'plot' do the unpacking..
1583
1583
@docstring .dedent_interpd
1584
1584
def semilogy (self , * args , ** kwargs ):
1585
1585
"""
@@ -1632,7 +1632,7 @@ def semilogy(self, *args, **kwargs):
1632
1632
1633
1633
return l
1634
1634
1635
- @unpack_labeled_data ()
1635
+ @unpack_labeled_data (replace_names = [ x ], label_namer = "x" )
1636
1636
@docstring .dedent_interpd
1637
1637
def acorr (self , x , ** kwargs ):
1638
1638
"""
@@ -1694,7 +1694,7 @@ def acorr(self, x, **kwargs):
1694
1694
"""
1695
1695
return self .xcorr (x , x , ** kwargs )
1696
1696
1697
- @unpack_labeled_data ()
1697
+ @unpack_labeled_data (replace_names = [ "x" , "y" ], label_namer = "y" )
1698
1698
@docstring .dedent_interpd
1699
1699
def xcorr (self , x , y , normed = True , detrend = mlab .detrend_none ,
1700
1700
usevlines = True , maxlags = 10 , ** kwargs ):
@@ -1784,7 +1784,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1784
1784
1785
1785
#### Specialized plotting
1786
1786
1787
- @unpack_labeled_data ()
1787
+ @unpack_labeled_data (replace_names = [ "x" , "y" ], label_namer = "y" )
1788
1788
def step (self , x , y , * args , ** kwargs ):
1789
1789
"""
1790
1790
Make a step plot.
@@ -1822,7 +1822,9 @@ def step(self, x, y, *args, **kwargs):
1822
1822
1823
1823
return self .plot (x , y , * args , ** kwargs )
1824
1824
1825
- @unpack_labeled_data ()
1825
+ @unpack_labeled_data (replace_names = ["left" , "height" , "width" , "bottom" , "color" , "edgecolor" ,
1826
+ "linewidth" , "tick_label" , "xerr" , "yerr" , "ecolor" ],
1827
+ label_namer = None )
1826
1828
@docstring .dedent_interpd
1827
1829
def bar (self , left , height , width = 0.8 , bottom = None , ** kwargs ):
1828
1830
"""
@@ -2249,7 +2251,7 @@ def barh(self, bottom, width, height=0.8, left=None, **kwargs):
2249
2251
bottom = bottom , orientation = 'horizontal' , ** kwargs )
2250
2252
return patches
2251
2253
2252
- @unpack_labeled_data ()
2254
+ # @unpack_labeled_data() # not df["name"] getable...
2253
2255
@docstring .dedent_interpd
2254
2256
def broken_barh (self , xranges , yrange , ** kwargs ):
2255
2257
"""
@@ -2295,7 +2297,7 @@ def broken_barh(self, xranges, yrange, **kwargs):
2295
2297
2296
2298
return col
2297
2299
2298
- @unpack_labeled_data ()
2300
+ @unpack_labeled_data (replace_all_args = True , label_namer = None )
2299
2301
def stem (self , * args , ** kwargs ):
2300
2302
"""
2301
2303
Create a stem plot.
@@ -2603,7 +2605,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
2603
2605
else :
2604
2606
return slices , texts , autotexts
2605
2607
2606
- @unpack_labeled_data ()
2608
+ @unpack_labeled_data (replace_names = [ "x" , "y" , "xerr" , "yerr" ,], label_namer = "y" )
2607
2609
@docstring .dedent_interpd
2608
2610
def errorbar (self , x , y , yerr = None , xerr = None ,
2609
2611
fmt = '' , ecolor = None , elinewidth = None , capsize = None ,
@@ -4347,7 +4349,7 @@ def quiverkey(self, *args, **kw):
4347
4349
return qk
4348
4350
quiverkey .__doc__ = mquiver .QuiverKey .quiverkey_doc
4349
4351
4350
- @unpack_labeled_data ()
4352
+ @unpack_labeled_data (replace_all_args = True , label_namer = None )
4351
4353
def quiver (self , * args , ** kw ):
4352
4354
if not self ._hold :
4353
4355
self .cla ()
@@ -4358,12 +4360,12 @@ def quiver(self, *args, **kw):
4358
4360
return q
4359
4361
quiver .__doc__ = mquiver .Quiver .quiver_doc
4360
4362
4361
- @unpack_labeled_data ()
4363
+ @unpack_labeled_data (replace_all_args = True , label_namer = None )
4362
4364
def stackplot (self , x , * args , ** kwargs ):
4363
4365
return mstack .stackplot (self , x , * args , ** kwargs )
4364
4366
stackplot .__doc__ = mstack .stackplot .__doc__
4365
4367
4366
- @unpack_labeled_data ()
4368
+ # @unpack_labeled_data() # doesn't really work, as x and y have different shapes
4367
4369
def streamplot (self , x , y , u , v , density = 1 , linewidth = None , color = None ,
4368
4370
cmap = None , norm = None , arrowsize = 1 , arrowstyle = '-|>' ,
4369
4371
minlength = 0.1 , transform = None , zorder = 1 , start_points = None ):
@@ -4384,7 +4386,7 @@ def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
4384
4386
return stream_container
4385
4387
streamplot .__doc__ = mstream .streamplot .__doc__
4386
4388
4387
- @unpack_labeled_data ()
4389
+ @unpack_labeled_data (replace_all_args = True , label_namer = None )
4388
4390
@docstring .dedent_interpd
4389
4391
def barbs (self , * args , ** kw ):
4390
4392
"""
@@ -4401,7 +4403,8 @@ def barbs(self, *args, **kw):
4401
4403
self .autoscale_view ()
4402
4404
return b
4403
4405
4404
- @unpack_labeled_data ()
4406
+ @unpack_labeled_data (replace_names = ["x" , "y" ], label_namer = None ,
4407
+ positional_parameter_names = ["x" , "y" , "c" ])
4405
4408
@docstring .dedent_interpd
4406
4409
def fill (self , * args , ** kwargs ):
4407
4410
"""
@@ -4453,7 +4456,7 @@ def fill(self, *args, **kwargs):
4453
4456
self .autoscale_view ()
4454
4457
return patches
4455
4458
4456
- @unpack_labeled_data ()
4459
+ @unpack_labeled_data (replace_names = [ "x" , "y1" , "y2" , "where" ], label_namer = None )
4457
4460
@docstring .dedent_interpd
4458
4461
def fill_between (self , x , y1 , y2 = 0 , where = None , interpolate = False ,
4459
4462
step = None ,
@@ -4607,7 +4610,7 @@ def get_interp_point(ind):
4607
4610
self .autoscale_view ()
4608
4611
return collection
4609
4612
4610
- @unpack_labeled_data ()
4613
+ @unpack_labeled_data (replace_names = [ "y" , "x1" , "x2" , "where" ], label_namer = None )
4611
4614
@docstring .dedent_interpd
4612
4615
def fill_betweenx (self , y , x1 , x2 = 0 , where = None ,
4613
4616
step = None , ** kwargs ):
@@ -4732,7 +4735,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
4732
4735
return collection
4733
4736
4734
4737
#### plotting z(x,y): imshow, pcolor and relatives, contour
4735
- @unpack_labeled_data ()
4738
+ # @unpack_labeled_data() # nothing which could be in an DataFrame
4736
4739
@docstring .dedent_interpd
4737
4740
def imshow (self , X , cmap = None , norm = None , aspect = None ,
4738
4741
interpolation = None , alpha = None , vmin = None , vmax = None ,
@@ -4937,7 +4940,7 @@ def _pcolorargs(funcname, *args, **kw):
4937
4940
C = C [:Ny - 1 , :Nx - 1 ]
4938
4941
return X , Y , C
4939
4942
4940
- @unpack_labeled_data ()
4943
+ # @unpack_labeled_data() # 2d data can't be df["name"]'ed
4941
4944
@docstring .dedent_interpd
4942
4945
def pcolor (self , * args , ** kwargs ):
4943
4946
"""
@@ -5214,7 +5217,7 @@ def pcolor(self, *args, **kwargs):
5214
5217
self .add_collection (collection , autolim = False )
5215
5218
return collection
5216
5219
5217
- @unpack_labeled_data ()
5220
+ # @unpack_labeled_data() # 2d data can't be df["name"]'ed
5218
5221
@docstring .dedent_interpd
5219
5222
def pcolormesh (self , * args , ** kwargs ):
5220
5223
"""
@@ -5363,7 +5366,7 @@ def pcolormesh(self, *args, **kwargs):
5363
5366
self .add_collection (collection , autolim = False )
5364
5367
return collection
5365
5368
5366
- @unpack_labeled_data ()
5369
+ # @unpack_labeled_data() #2d data can't be df["name"]'ed
5367
5370
@docstring .dedent_interpd
5368
5371
def pcolorfast (self , * args , ** kwargs ):
5369
5372
"""
@@ -5551,15 +5554,15 @@ def pcolorfast(self, *args, **kwargs):
5551
5554
self .autoscale_view (tight = True )
5552
5555
return ret
5553
5556
5554
- @unpack_labeled_data ()
5557
+ # @unpack_labeled_data() # takes 2d data :-(
5555
5558
def contour (self , * args , ** kwargs ):
5556
5559
if not self ._hold :
5557
5560
self .cla ()
5558
5561
kwargs ['filled' ] = False
5559
5562
return mcontour .QuadContourSet (self , * args , ** kwargs )
5560
5563
contour .__doc__ = mcontour .QuadContourSet .contour_doc
5561
5564
5562
- @unpack_labeled_data ()
5565
+ # @unpack_labeled_data() # takes 2d data :-(
5563
5566
def contourf (self , * args , ** kwargs ):
5564
5567
if not self ._hold :
5565
5568
self .cla ()
@@ -5600,7 +5603,7 @@ def table(self, **kwargs):
5600
5603
5601
5604
#### Data analysis
5602
5605
5603
- @unpack_labeled_data ()
5606
+ @unpack_labeled_data (replace_names = [ "x" ], label_namer = "x" )
5604
5607
@docstring .dedent_interpd
5605
5608
def hist (self , x , bins = 10 , range = None , normed = False , weights = None ,
5606
5609
cumulative = False , bottom = None , histtype = 'bar' , align = 'mid' ,
@@ -6141,7 +6144,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
6141
6144
else :
6142
6145
return n , bins , cbook .silent_list ('Lists of Patches' , patches )
6143
6146
6144
- @unpack_labeled_data ()
6147
+ @unpack_labeled_data (replace_names = [ "x" , "y" , "weights" ], label_namer = None )
6145
6148
@docstring .dedent_interpd
6146
6149
def hist2d (self , x , y , bins = 10 , range = None , normed = False , weights = None ,
6147
6150
cmin = None , cmax = None , ** kwargs ):
@@ -6235,7 +6238,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
6235
6238
6236
6239
return h , xedges , yedges , pc
6237
6240
6238
- @unpack_labeled_data ()
6241
+ @unpack_labeled_data (replace_names = [ "x" ], label_namer = None )
6239
6242
@docstring .dedent_interpd
6240
6243
def psd (self , x , NFFT = None , Fs = None , Fc = None , detrend = None ,
6241
6244
window = None , noverlap = None , pad_to = None ,
@@ -6360,7 +6363,7 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
6360
6363
else :
6361
6364
return pxx , freqs , line
6362
6365
6363
- @unpack_labeled_data ()
6366
+ @unpack_labeled_data (replace_names = [ "x" , "y" ], label_namer = "y" )
6364
6367
@docstring .dedent_interpd
6365
6368
def csd (self , x , y , NFFT = None , Fs = None , Fc = None , detrend = None ,
6366
6369
window = None , noverlap = None , pad_to = None ,
@@ -6472,7 +6475,7 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
6472
6475
else :
6473
6476
return pxy , freqs , line
6474
6477
6475
- @unpack_labeled_data ()
6478
+ @unpack_labeled_data (replace_names = [ "x" ], label_namer = None )
6476
6479
@docstring .dedent_interpd
6477
6480
def magnitude_spectrum (self , x , Fs = None , Fc = None , window = None ,
6478
6481
pad_to = None , sides = None , scale = None ,
@@ -6572,7 +6575,7 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
6572
6575
6573
6576
return spec , freqs , lines [0 ]
6574
6577
6575
- @unpack_labeled_data ()
6578
+ @unpack_labeled_data (replace_names = [ "x" ], label_namer = None )
6576
6579
@docstring .dedent_interpd
6577
6580
def angle_spectrum (self , x , Fs = None , Fc = None , window = None ,
6578
6581
pad_to = None , sides = None , ** kwargs ):
@@ -6650,7 +6653,7 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
6650
6653
6651
6654
return spec , freqs , lines [0 ]
6652
6655
6653
- @unpack_labeled_data ()
6656
+ @unpack_labeled_data (replace_names = [ "x" ], label_namer = None )
6654
6657
@docstring .dedent_interpd
6655
6658
def phase_spectrum (self , x , Fs = None , Fc = None , window = None ,
6656
6659
pad_to = None , sides = None , ** kwargs ):
@@ -6728,7 +6731,7 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
6728
6731
6729
6732
return spec , freqs , lines [0 ]
6730
6733
6731
- @unpack_labeled_data ()
6734
+ @unpack_labeled_data (replace_names = [ "x" , "y" ], label_namer = None )
6732
6735
@docstring .dedent_interpd
6733
6736
def cohere (self , x , y , NFFT = 256 , Fs = 2 , Fc = 0 , detrend = mlab .detrend_none ,
6734
6737
window = mlab .window_hanning , noverlap = 0 , pad_to = None ,
@@ -6796,7 +6799,7 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
6796
6799
6797
6800
return cxy , freqs
6798
6801
6799
- @unpack_labeled_data ()
6802
+ @unpack_labeled_data (replace_names = [ "x" ], label_namer = None )
6800
6803
@docstring .dedent_interpd
6801
6804
def specgram (self , x , NFFT = None , Fs = None , Fc = None , detrend = None ,
6802
6805
window = None , noverlap = None ,
@@ -7114,7 +7117,7 @@ def matshow(self, Z, **kwargs):
7114
7117
integer = True ))
7115
7118
return im
7116
7119
7117
- @unpack_labeled_data ()
7120
+ @unpack_labeled_data ( replace_all_args = True , label_namer = None )
7118
7121
def violinplot (self , dataset , positions = None , vert = True , widths = 0.5 ,
7119
7122
showmeans = False , showextrema = True , showmedians = False ,
7120
7123
points = 100 , bw_method = None ):
@@ -7216,7 +7219,7 @@ def _kde_method(X, coords):
7216
7219
widths = widths , showmeans = showmeans ,
7217
7220
showextrema = showextrema , showmedians = showmedians )
7218
7221
7219
- @unpack_labeled_data ()
7222
+ @unpack_labeled_data (replace_all_args = True , label_namer = None )
7220
7223
def violin (self , vpstats , positions = None , vert = True , widths = 0.5 ,
7221
7224
showmeans = False , showextrema = True , showmedians = False ):
7222
7225
"""Drawing function for violin plots.
0 commit comments