@@ -2857,50 +2857,18 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
28572857
28582858 # defaults for formats
28592859 if linefmt is None :
2860- try :
2861- # fallback to positional argument
2862- linefmt = args [0 ]
2863- except IndexError :
2864- linecolor = 'C0'
2865- linemarker = 'None'
2866- linestyle = '-'
2867- else :
2868- linestyle , linemarker , linecolor = \
2869- _process_plot_format (linefmt )
2870- else :
2871- linestyle , linemarker , linecolor = _process_plot_format (linefmt )
2860+ linefmt = args [0 ] if len (args ) > 0 else "C0-"
2861+ linestyle , linemarker , linecolor = _process_plot_format (linefmt )
28722862
28732863 if markerfmt is None :
2874- try :
2875- # fallback to positional argument
2876- markerfmt = args [1 ]
2877- except IndexError :
2878- markercolor = 'C0'
2879- markermarker = 'o'
2880- markerstyle = 'None'
2881- else :
2882- markerstyle , markermarker , markercolor = \
2883- _process_plot_format (markerfmt )
2884- else :
2885- markerstyle , markermarker , markercolor = \
2886- _process_plot_format (markerfmt )
2864+ markerfmt = args [1 ] if len (args ) > 1 else "C0o"
2865+ markerstyle , markermarker , markercolor = \
2866+ _process_plot_format (markerfmt )
28872867
28882868 if basefmt is None :
2889- try :
2890- # fallback to positional argument
2891- basefmt = args [2 ]
2892- except IndexError :
2893- if rcParams ['_internal.classic_mode' ]:
2894- basecolor = 'C2'
2895- else :
2896- basecolor = 'C3'
2897- basemarker = 'None'
2898- basestyle = '-'
2899- else :
2900- basestyle , basemarker , basecolor = \
2901- _process_plot_format (basefmt )
2902- else :
2903- basestyle , basemarker , basecolor = _process_plot_format (basefmt )
2869+ basefmt = (args [2 ] if len (args ) > 2 else
2870+ "C2-" if rcParams ["_internal.classic_mode" ] else "C3-" )
2871+ basestyle , basemarker , basecolor = _process_plot_format (basefmt )
29042872
29052873 # New behaviour in 3.1 is to use a LineCollection for the stemlines
29062874 if use_line_collection :
0 commit comments