@@ -2390,7 +2390,8 @@ def broken_barh(self, xranges, yrange, **kwargs):
2390
2390
return col
2391
2391
2392
2392
@_preprocess_data (replace_all_args = True , label_namer = None )
2393
- def stem (self , * args , ** kwargs ):
2393
+ def stem (self , * args , linefmt = None , markerfmt = None , basefmt = None , bottom = 0 ,
2394
+ label = None , ** kwargs ):
2394
2395
"""
2395
2396
Create a stem plot.
2396
2397
@@ -2449,6 +2450,15 @@ def stem(self, *args, **kwargs):
2449
2450
The label to use for the stems in legends.
2450
2451
2451
2452
2453
+ Other Parameters
2454
+ ----------------
2455
+ **kwargs
2456
+ No other parameters are supported. They are currently ignored
2457
+ silently for backward compatibility. This behavior is deprecated.
2458
+ Future versions will not accept any other parameters and will
2459
+ raise a TypeError instead.
2460
+
2461
+
2452
2462
Returns
2453
2463
-------
2454
2464
a :class:`~matplotlib.container.StemContainer`
@@ -2483,10 +2493,9 @@ def stem(self, *args, **kwargs):
2483
2493
x = second
2484
2494
2485
2495
# Popping some defaults
2486
- try :
2487
- linefmt = kwargs ['linefmt' ]
2488
- except KeyError :
2496
+ if linefmt is None :
2489
2497
try :
2498
+ # fallback to positional argument
2490
2499
linefmt = args [0 ]
2491
2500
except IndexError :
2492
2501
linecolor = 'C0'
@@ -2497,10 +2506,10 @@ def stem(self, *args, **kwargs):
2497
2506
_process_plot_format (linefmt )
2498
2507
else :
2499
2508
linestyle , linemarker , linecolor = _process_plot_format (linefmt )
2500
- try :
2501
- markerfmt = kwargs ['markerfmt' ]
2502
- except KeyError :
2509
+
2510
+ if markerfmt is None :
2503
2511
try :
2512
+ # fallback to positional argument
2504
2513
markerfmt = args [1 ]
2505
2514
except IndexError :
2506
2515
markercolor = 'C0'
@@ -2512,10 +2521,10 @@ def stem(self, *args, **kwargs):
2512
2521
else :
2513
2522
markerstyle , markermarker , markercolor = \
2514
2523
_process_plot_format (markerfmt )
2515
- try :
2516
- basefmt = kwargs ['basefmt' ]
2517
- except KeyError :
2524
+
2525
+ if basefmt is None :
2518
2526
try :
2527
+ # fallback to positional argument
2519
2528
basefmt = args [2 ]
2520
2529
except IndexError :
2521
2530
if rcParams ['_internal.classic_mode' ]:
@@ -2530,15 +2539,12 @@ def stem(self, *args, **kwargs):
2530
2539
else :
2531
2540
basestyle , basemarker , basecolor = _process_plot_format (basefmt )
2532
2541
2533
- bottom = kwargs . pop ( ' bottom' , None )
2534
- label = kwargs . pop ( 'label' , None )
2542
+ if bottom is None :
2543
+ bottom = 0
2535
2544
2536
2545
markerline , = self .plot (x , y , color = markercolor , linestyle = markerstyle ,
2537
2546
marker = markermarker , label = "_nolegend_" )
2538
2547
2539
- if bottom is None :
2540
- bottom = 0
2541
-
2542
2548
stemlines = []
2543
2549
for thisx , thisy in zip (x , y ):
2544
2550
l , = self .plot ([thisx , thisx ], [bottom , thisy ],
0 commit comments