@@ -2062,7 +2062,7 @@ def make_iterable(x):
2062
2062
2063
2063
errorbar = self .errorbar (x , y ,
2064
2064
yerr = yerr , xerr = xerr ,
2065
- fmt = None , ** error_kw )
2065
+ fmt = 'none' , ** error_kw )
2066
2066
else :
2067
2067
errorbar = None
2068
2068
@@ -2520,7 +2520,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
2520
2520
2521
2521
@docstring .dedent_interpd
2522
2522
def errorbar (self , x , y , yerr = None , xerr = None ,
2523
- fmt = '-' , ecolor = None , elinewidth = None , capsize = 3 ,
2523
+ fmt = None , ecolor = None , elinewidth = None , capsize = 3 ,
2524
2524
barsabove = False , lolims = False , uplims = False ,
2525
2525
xlolims = False , xuplims = False , errorevery = 1 , capthick = None ,
2526
2526
** kwargs ):
@@ -2530,7 +2530,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2530
2530
Call signature::
2531
2531
2532
2532
errorbar(x, y, yerr=None, xerr=None,
2533
- fmt='-' , ecolor=None, elinewidth=None, capsize=3,
2533
+ fmt=None , ecolor=None, elinewidth=None, capsize=3,
2534
2534
barsabove=False, lolims=False, uplims=False,
2535
2535
xlolims=False, xuplims=False, errorevery=1,
2536
2536
capthick=None)
@@ -2552,10 +2552,12 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2552
2552
If a sequence of shape 2xN, errorbars are drawn at -row1
2553
2553
and +row2 relative to the data.
2554
2554
2555
- *fmt*: '-'
2556
- The plot format symbol. If *fmt* is *None*, only the
2557
- errorbars are plotted. This is used for adding
2558
- errorbars to a bar plot, for example.
2555
+ *fmt*: [ *None* | 'none' | plot format string ]
2556
+ The plot format symbol. If *fmt* is 'none' (case-insensitive),
2557
+ only the errorbars are plotted. This is used for adding
2558
+ errorbars to a bar plot, for example. Default is *None*,
2559
+ equivalent to an empty plot format string; properties are
2560
+ then identical to the defaults for :meth:`plot`.
2559
2561
2560
2562
*ecolor*: [ *None* | mpl color ]
2561
<
8000
code>2563 A matplotlib color arg which gives the color the errorbar lines;
@@ -2635,6 +2637,12 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2635
2637
holdstate = self ._hold
2636
2638
self ._hold = True
2637
2639
2640
+ plot_line = True
2641
+ if fmt is None :
2642
+ fmt = "" # Plot points using plot method with rcParams defaults.
2643
+ elif fmt .lower () == 'none' :
2644
+ plot_line = False # Don't plot the points at all.
2645
+
2638
2646
label = kwargs .pop ("label" , None )
2639
2647
2640
2648
# make sure all the args are iterable; use lists not arrays to
@@ -2655,7 +2663,9 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2655
2663
2656
2664
l0 = None
2657
2665
2658
- if barsabove and fmt is not None :
2666
+ # Instead of using zorder, the line plot is being added
2667
+ # either here, or after all the errorbar plot elements.
2668
+ if barsabove and plot_line :
2659
2669
l0 , = self .plot (x , y , fmt , label = "_nolegend_" , ** kwargs )
2660
2670
2661
2671
barcols = []
@@ -2838,7 +2848,7 @@ def xywhere(xs, ys, mask):
2838
2848
xup , yup = xywhere (x , y , uplims & everymask )
2839
2849
caplines .extend (self .plot (xup , yup , 'k_' , ** plot_kw ))
2840
2850
2841
- if not barsabove and fmt is not None :
2851
+ if not barsabove and plot_line :
2842
2852
l0 , = self .plot (x , y , fmt , ** kwargs )
2843
2853
2844
2854
if ecolor is None :
0 commit comments