@@ -1114,7 +1114,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1114
1114
positional_parameter_names = _plot_args_replacer ,
1115
1115
label_namer = None )
1116
1116
@docstring .dedent_interpd
1117
- def plot (self , * args , ** kwargs ):
1117
+ def plot (self , * args , scalex = True , scaley = True , ** kwargs ):
1118
1118
"""
1119
1119
Plot y versus x as lines and/or markers.
1120
1120
@@ -1341,8 +1341,6 @@ def plot(self, *args, **kwargs):
1341
1341
'k^:' # black triangle_up markers connected by a dotted line
1342
1342
1343
1343
"""
1344
- scalex = kwargs .pop ('scalex' , True )
1345
- scaley = kwargs .pop ('scaley' , True )
1346
1344
lines = []
1347
1345
1348
1346
kwargs = cbook .normalize_kwargs (kwargs , mlines .Line2D ._alias_map )
@@ -1734,7 +1732,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1734
1732
#### Specialized plotting
1735
1733
1736
1734
@_preprocess_data (replace_names = ["x" , "y" ], label_namer = "y" )
1737
- def step (self , x , y , * args , ** kwargs ):
1735
+ def step (self , x , y , * args , where = 'pre' , linestyle = '' , ** kwargs ):
1738
1736
"""
1739
1737
Make a step plot.
1740
1738
@@ -1795,12 +1793,10 @@ def step(self, x, y, *args, **kwargs):
1795
1793
-----
1796
1794
.. [notes section required to get data note injection right]
1797
1795
"""
1798
- where = kwargs .pop ('where' , 'pre' )
1799
1796
if where not in ('pre' , 'post' , 'mid' ):
1800
1797
raise ValueError ("'where' argument to step must be "
1801
1798
"'pre', 'post' or 'mid'" )
1802
- usr_linestyle = kwargs .pop ('linestyle' , '' )
1803
- kwargs ['linestyle' ] = 'steps-' + where + usr_linestyle
1799
+ kwargs ['linestyle' ] = 'steps-' + where + linestyle
1804
1800
1805
1801
return self .plot (x , y , * args , ** kwargs )
1806
1802
@@ -2268,7 +2264,8 @@ def broken_barh(self, xranges, yrange, **kwargs):
2268
2264
return col
2269
2265
2270
2266
@_preprocess_data (replace_all_args = True , label_namer = None )
2271
- def stem (self , * args , ** kwargs ):
2267
+ def stem (self , * args , linefmt = None , markerfmt = None , basefmt = None ,
2268
+ bottom = 0 , label = None ):
2272
2269
"""
2273
2270
Create a stem plot.
2274
2271
@@ -2328,15 +2325,6 @@ def stem(self, *args, **kwargs):
2328
2325
The label to use for the stems in legends.
2329
2326
2330
2327
2331
- Other Parameters
2332
- ----------------
2333
- **kwargs
2334
- No other parameters are supported. They are currently ignored
2335
- silently for backward compatibility. This behavior is deprecated.
2336
- Future versions will not accept any other parameters and will
2337
- raise a TypeError instead.
2338
-
2339
-
2340
2328
Returns
2341
2329
-------
2342
2330
:class:`~matplotlib.container.StemContainer`
@@ -2353,41 +2341,18 @@ def stem(self, *args, **kwargs):
2353
2341
which inspired this method.
2354
2342
2355
2343
"""
2356
-
2357
- # kwargs handling
2358
- # We would like to have a signature with explicit kewords:
2359
- # stem(*args, linefmt=None, markerfmt=None, basefmt=None,
2360
- # bottom=0, label=None)
2361
- # Unfortunately, this is not supported in Python 2.x. There, *args
2362
- # can only exist after keyword arguments.
2363
- linefmt = kwargs .pop ('linefmt' , None )
2364
- markerfmt = kwargs .pop ('markerfmt' , None )
2365
- basefmt = kwargs .pop ('basefmt' , None )
2366
- bottom = kwargs .pop ('bottom' , None )
2367
- if bottom is None :
2368
- bottom = 0
2369
- label = kwargs .pop ('label' , None )
2370
- if kwargs :
2371
- warn_deprecated (since = '2.2' ,
2372
- message = "stem() got an unexpected keyword "
2373
- "argument '%s'. This will raise a "
2374
- "TypeError in future versions." % (
2375
- next (k for k in kwargs ), )
2376
- )
2377
-
2378
2344
# Assume there's at least one data array
2379
2345
y = np .asarray (args [0 ])
2380
2346
args = args [1 :]
2381
2347
2382
2348
# Try a second one
2383
2349
try :
2384
- second = np .asarray (args [0 ], dtype = float )
2385
- x , y = y , second
2386
- args = args [1 :]
2350
+ x , y = y , np .asarray (args [0 ], dtype = float )
2387
2351
except (IndexError , ValueError ):
2388
2352
# The second array doesn't make sense, or it doesn't exist
2389
- second = np .arange (len (y ))
2390
- x = second
2353
+ x = np .arange (len (y ))
2354
+ else :
2355
+ args = args [1 :]
2391
2356
2392
2357
# defaults for formats
2393
2358
if linefmt is None :
@@ -5242,7 +5207,8 @@ def _pcolorargs(funcname, *args, allmatch=False):
5242
5207
5243
5208
@_preprocess_data (label_namer = None )
5244
5209
@docstring .dedent_interpd
5245
- def pcolor (self , * args , ** kwargs ):
5210
+ def pcolor (self , * args , alpha = None , norm = None , cmap = None , vmin = None ,
5211
+ vmax = None , ** kwargs ):
5246
5212
"""
5247
5213
Create a pseudocolor plot of a 2-D array.
5248
5214
@@ -5381,12 +5347,6 @@ def pcolor(self, *args, **kwargs):
5381
5347
not specified, or if ``X`` and ``Y`` have one more row and column than
5382
5348
``C``.
5383
5349
"""
5384
- alpha = kwargs .pop ('alpha' , None )
5385
- norm = kwargs .pop ('norm' , None )
5386
- cmap = kwargs .pop ('cmap' , None )
5387
- vmin = kwargs .pop ('vmin' , None )
5388
- vmax = kwargs .pop ('vmax' , None )
5389
-
5390
5350
X , Y , C = self ._pcolorargs ('pcolor' , * args , allmatch = False )
5391
5351
Ny , Nx = X .shape
5392
5352
@@ -5488,7 +5448,8 @@ def pcolor(self, *args, **kwargs):
5488
5448
5489
5449
@_preprocess_data (label_namer = None )
5490
5450
@docstring .dedent_interpd
5491
- def pcolormesh (self , * args , ** kwargs ):
5451
+ def pcolormesh (self , * args , alpha = None , norm = None , cmap = None , vmin = None ,
5452
+ vmax = None , shading = 'flat' , antialiased = False , ** kwargs ):
5492
5453
"""
5493
5454
Plot a quadrilateral mesh.
5494
5455
@@ -5564,13 +5525,7 @@ def pcolormesh(self, *args, **kwargs):
5564
5525
5565
5526
%(QuadMesh)s
5566
5527
"""
5567
- alpha = kwargs .pop ('alpha' , None )
5568
- norm = kwargs .pop ('norm' , None )
5569
- cmap = kwargs .pop ('cmap' , None )
5570
- vmin = kwargs .pop ('vmin' , None )
5571
- vmax = kwargs .pop ('vmax' , None )
5572
- shading = kwargs .pop ('shading' , 'flat' ).lower ()
5573
- antialiased = kwargs .pop ('antialiased' , False )
5528
+ shading = shading .lower ()
5574
5529
kwargs .setdefault ('edgecolors' , 'None' )
5575
5530
5576
5531
allmatch = (shading == 'gouraud' )
@@ -5625,7 +5580,8 @@ def pcolormesh(self, *args, **kwargs):
5625
5580
5626
5581
@_preprocess_data (label_namer = None )
5627
5582
@docstring .dedent_interpd
5628
- def pcolorfast (self , * args , ** kwargs ):
5583
+ def pcolorfast (self , * args , alpha = None , norm = None , cmap = None , vmin = None ,
5584
+ vmax = None , ** kwargs ):
5629
5585
"""
5630
5586
pseudocolor plot of a 2-D array
5631
5587
@@ -5707,11 +5663,6 @@ def pcolorfast(self, *args, **kwargs):
5707
5663
collection in the general quadrilateral case.
5708
5664
5709
5665
"""
5710
- alpha = kwargs .pop ('alpha' , None )
5711
- norm = kwargs .pop ('norm' , None )
5712
- cmap = kwargs .pop ('cmap' , None )
5713
- vmin = kwargs .pop ('vmin' , None )
5714
- vmax = kwargs .pop ('vmax' , None )
5715
5666
if norm is not None and not isinstance (norm , mcolors .Normalize ):
5716
5667
raise ValueError (
5717
5668
"'norm' must be an instance of 'mcolors.Normalize'" )
0 commit comments