@@ -2614,8 +2614,7 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
2614
2614
For horizontal stem plots, the x-values of the stem heads.
2615
2615
2616
2616
linefmt : str, optional
2617
- A string defining the properties of the vertical lines. Usually,
2618
- this will be a color or a color and a linestyle:
2617
+ A string defining the color and/or linestyle of the vertical lines:
2619
2618
2620
2619
========= =============
2621
2620
Character Line Style
@@ -2629,15 +2628,14 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
2629
2628
Default: 'C0-', i.e. solid line with the first color of the color
2630
2629
cycle.
2631
2630
2632
- Note: While it is technically possible to specify valid formats
2633
- other than color or color and linestyle (e.g. 'rx' or '-.'), this
2634
- is beyond the intention of the method and will most likely not
2635
- result in a reasonable plot.
2631
+ Note: Markers specified through this parameter (e.g. 'x') will be
2632
+ silently ignored (unless using ``use_line_collection=False``).
2633
+ Instead, markers should be specified using *markerfmt*.
2636
2634
2637
2635
markerfmt : str, optional
2638
- A string defining the properties of the markers at the stem heads.
2639
- Default: 'C0o', i.e. filled circles with the first color of the
2640
- color cycle.
2636
+ A string defining the color and/or shape of the markers at the stem
2637
+ heads. Default: 'C0o', i.e. filled circles with the first color of
2638
+ the color cycle.
2641
2639
2642
2640
basefmt : str, default: 'C3-' ('C2-' in classic mode)
2643
2641
A format string defining the properties of the baseline.
@@ -2738,20 +2736,12 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
2738
2736
2739
2737
# New behaviour in 3.1 is to use a LineCollection for the stemlines
2740
2738
if use_line_collection :
2741
- if orientation == 'horizontal' :
2742
- stemlines = [
2743
- ((bottom , loc ), (head , loc ))
2744
- for loc , head in zip (locs , heads )]
2745
- else :
2746
- stemlines = [
2747
- ((loc , bottom ), (loc , head ))
2748
- for loc , head in zip (locs , heads )]
2749
2739
if linestyle is None :
2750
2740
linestyle = rcParams ['lines.linestyle' ]
2751
- stemlines = mcoll . LineCollection ( stemlines , linestyles = linestyle ,
2752
- colors = linecolor ,
2753
- label = '_nolegend_' )
2754
- self . add_collection ( stemlines )
2741
+ xlines = self . vlines if orientation == "vertical" else self . hlines
2742
+ stemlines = xlines (
2743
+ locs , bottom , heads ,
2744
+ colors = linecolor , linestyles = linestyle , label = "_nolegend_" )
2755
2745
# Old behaviour is to plot each of the lines individually
2756
2746
else :
2757
2747
stemlines = []
0 commit comments