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