diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 66af3dd8038c..b55d4a1199e6 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2881,50 +2881,18 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0, # defaults for formats if linefmt is None: - try: - # fallback to positional argument - linefmt = args[0] - except IndexError: - linecolor = 'C0' - linemarker = 'None' - linestyle = '-' - else: - linestyle, linemarker, linecolor = \ - _process_plot_format(linefmt) - else: - linestyle, linemarker, linecolor = _process_plot_format(linefmt) + linefmt = args[0] if len(args) > 0 else "C0-" + linestyle, linemarker, linecolor = _process_plot_format(linefmt) if markerfmt is None: - try: - # fallback to positional argument - markerfmt = args[1] - except IndexError: - markercolor = 'C0' - markermarker = 'o' - markerstyle = 'None' - else: - markerstyle, markermarker, markercolor = \ - _process_plot_format(markerfmt) - else: - markerstyle, markermarker, markercolor = \ - _process_plot_format(markerfmt) + markerfmt = args[1] if len(args) > 1 else "C0o" + markerstyle, markermarker, markercolor = \ + _process_plot_format(markerfmt) if basefmt is None: - try: - # fallback to positional argument - basefmt = args[2] - except IndexError: - if rcParams['_internal.classic_mode']: - basecolor = 'C2' - else: - basecolor = 'C3' - basemarker = 'None' - basestyle = '-' - else: - basestyle, basemarker, basecolor = \ - _process_plot_format(basefmt) - else: - basestyle, basemarker, basecolor = _process_plot_format(basefmt) + basefmt = (args[2] if len(args) > 2 else + "C2-" if rcParams["_internal.classic_mode"] else "C3-") + basestyle, basemarker, basecolor = _process_plot_format(basefmt) # New behaviour in 3.1 is to use a LineCollection for the stemlines if use_line_collection: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy