@@ -2416,34 +2416,71 @@ def stem(self, *args, **kwargs):
2416
2416
2417
2417
# Popping some defaults
2418
2418
try :
2419
- linefmt = kwargs .pop ('linefmt' , args [0 ])
2420
- except IndexError :
2421
- linefmt = kwargs .pop ('linefmt' , 'b-' )
2419
+ linefmt = kwargs ['linefmt' ]
2420
+ except KeyError :
2421
+ try :
2422
+ linefmt = args [0 ]
2423
+ except IndexError :
2424
+ linecolor = 'C0'
2425
+ linemarker = 'None'
2426
+ linestyle = '-'
2427
+ else :
2428
+ linestyle , linemarker , linecolor = \
2429
+ _process_plot_format (linefmt )
2430
+ else :
2431
+ linestyle , linemarker , linecolor = _process_plot_format (linefmt )
2422
2432
try :
2423
- markerfmt = kwargs .pop ('markerfmt' , args [1 ])
2424
- except IndexError :
2425
- markerfmt = kwargs .pop ('markerfmt' , 'bo' )
2433
+ markerfmt = kwargs ['markerfmt' ]
2434
+ except KeyError :
2435
+ try :
2436
+ markerfmt = args [1 ]
2437
+ except IndexError :
2438
+ markercolor = 'C0'
2439
+ markermarker = 'o'
2440
+ markerstyle = 'None'
2441
+ else :
2442
+ markerstyle , markermarker , markercolor = \
2443
+ _process_plot_format (markerfmt )
2444
+ else :
2445
+ markerstyle , markermarker , markercolor = \
2446
+ _process_plot_format (markerfmt )
2426
2447
try :
2427
- basefmt = kwargs .pop ('basefmt' , args [2 ])
2428
- except IndexError :
2429
- basefmt = kwargs .pop ('basefmt' , 'r-' )
2448
+ basefmt = kwargs ['basefmt' ]
2449
+ except KeyError :
2450
+ try :
2451
+ basefmt = args [2 ]
2452
+ except IndexError :
2453
+ if rcParams ['_internal.classic_mode' ]:
2454
+ basecolor = 'C2'
2455
+ else :
2456
+ basecolor = 'C3'
2457
+ basemarker = 'None'
2458
+ basestyle = '-'
2459
+ else :
2460
+ basestyle , basemarker , basecolor = \
2461
+ _process_plot_format (basefmt )
2462
+ else :
2463
+ basestyle , basemarker , basecolor = _process_plot_format (basefmt )
2430
2464
2431
2465
bottom = kwargs .pop ('bottom' , None )
2432
2466
label = kwargs .pop ('label' , None )
2433
2467
2434
- markerline , = self .plot (x , y , markerfmt , label = "_nolegend_" )
2468
+ markerline , = self .plot (x , y , color = markercolor , linestyle = markerstyle ,
2469
+ marker = markermarker , label = "_nolegend_" )
2435
2470
2436
2471
if bottom is None :
2437
2472
bottom = 0
2438
2473
2439
2474
stemlines = []
2440
2475
for thisx , thisy in zip (x , y ):
2441
- l , = self .plot ([thisx , thisx ], [bottom , thisy ], linefmt ,
2442
- label = "_nolegend_" )
2476
+ l , = self .plot ([thisx , thisx ], [bottom , thisy ],
2477
+ color = linecolor , linestyle = linestyle ,
2478
+ marker = linemarker , label = "_nolegend_" )
2443
2479
stemlines .append (l )
2444
2480
2445
2481
baseline , = self .plot ([np .amin (x ), np .amax (x )], [bottom , bottom ],
2446
- basefmt , label = "_nolegend_" )
2482
+ color = basecolor , linestyle = basestyle ,
2483
+ marker = basemarker , label = "_nolegend_" )
2447
2484
2448
2485
self .hold (remember_hold )
2449
2486
0 commit comments