15
15
rcParams = matplotlib .rcParams
16
16
17
17
import matplotlib .cbook as cbook
18
- from matplotlib .cbook import _string_to_bool
18
+ from matplotlib .cbook import _string_to_bool , mplDeprecation
19
19
import matplotlib .collections as mcoll
20
20
import matplotlib .colors as mcolors
21
21
import matplotlib .contour as mcontour
@@ -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 = '' , 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='', 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' | 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 '',
2559
+ 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
2563
A matplotlib color arg which gives the color the errorbar lines;
@@ -2635,6 +2637,15 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2635
2637
holdstate = self ._hold
2636
2638
self ._hold = True
2637
2639
2640
+ if fmt is None :
2641
+ fmt = 'none'
2642
+ msg = ('Use of None object as fmt keyword argument to '
2643
+ + 'suppress plotting of data values is deprecated '
2644
+ + 'since 1.4; use the string "none" instead.' )
2645
+ warnings .warn (msg , mplDeprecation , stacklevel = 1 )
2646
+
2647
+ plot_line = (fmt .lower () != 'none' )
2648
+
2638
2649
label = kwargs .pop ("label" , None )
2639
2650
2640
2651
# make sure all the args are iterable; use lists not arrays to
@@ -2655,7 +2666,9 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2655
2666
2656
2667
l0 = None
2657
2668
2658
- if barsabove and fmt is not None :
2669
+ # Instead of using zorder, the line plot is being added
2670
+ # either here, or after all the errorbar plot elements.
2671
+ if barsabove and plot_line :
2659
2672
l0 , = self .plot (x , y , fmt , label = "_nolegend_" , ** kwargs )
2660
2673
2661
2674
barcols = []
@@ -2838,7 +2851,7 @@ def xywhere(xs, ys, mask):
2838
2851
xup , yup = xywhere (x , y , uplims & everymask )
2839
2852
caplines .extend (self .plot (xup , yup , 'k_' , ** plot_kw ))
2840
2853
2841
- if not barsabove and fmt is not None :
2854
+ if not barsabove and plot_line :
2842
2855
l0 , = self .plot (x , y , fmt , ** kwargs )
2843
2856
2844
2857
if ecolor is None :
0 commit comments