@@ -546,13 +546,14 @@ def _auto_format_1d(
546546 # NOTE: Where columns represent distributions, like for box and violin plots or
547547 # where we use 'means' or 'medians', columns coords (axis 1) are 'x' coords.
548548 # Otherwise, columns represent e.g. lines, and row coords (axis 0) are 'x' coords.
549- xaxis = int (box or hist or kwargs .get ('means' ) or kwargs .get ('medians' ) or False )
549+ reduce = any (kwargs .get (s ) for s in ('mean' , 'means' , 'median' , 'medians' ))
550+ sx = int (box or hist or reduce or False )
550551 if hist :
551552 if labels is None :
552- labels = _get_labels (ys [0 ], axis = xaxis , always = False ) # hist labels
553+ labels = _get_labels (ys [0 ], axis = sx , always = False ) # hist labels
553554 else :
554555 if x is None :
555- x = _get_labels (ys [0 ], axis = xaxis ) # infer from rows or columns
556+ x = _get_labels (ys [0 ], axis = sx ) # infer from rows or columns
556557 x = _to_arraylike (x )
557558
558559 # The labels and XY axis settings
@@ -1185,10 +1186,11 @@ def _get_error_data(
11851186@_deprecate_add_errorbars
11861187def indicate_error (
11871188 self , func , * args ,
1188- medians = False , means = False ,
1189- boxdata = None , bardata = None , shadedata = None , fadedata = None ,
1190- boxstds = None , barstds = None , shadestds = None , fadestds = None ,
1191- boxpctiles = None , barpctiles = None , shadepctiles = None , fadepctiles = None ,
1189+ mean = None , means = None , median = None , medians = None ,
1190+ barstd = None , barstds = None , barpctile = None , barpctiles = None , bardata = None ,
1191+ boxstd = None , boxstds = None , boxpctile = None , boxpctiles = None , boxdata = None ,
1192+ shadestd = None , shadestds = None , shadepctile = None , shadepctiles = None , shadedata = None ,
1193+ fadestd = None , fadestds = None , fadepctile = None , fadepctiles = None , fadedata = None ,
11921194 boxmarker = None , boxmarkercolor = 'white' ,
11931195 boxcolor = None , barcolor = None , shadecolor = None , fadecolor = None ,
11941196 shadelabel = False , fadelabel = False , shadealpha = 0.4 , fadealpha = 0.2 ,
@@ -1211,27 +1213,27 @@ def indicate_error(
12111213 ----------
12121214 *args
12131215 The input data.
1214- means : bool, optional
1216+ mean, means : bool, optional
12151217 Whether to plot the means of each column in the input data. If no other
1216- arguments specified, this also sets ``barstds =True`` (and ``boxstds =True``
1218+ arguments specified, this also sets ``barstd =True`` (and ``boxstd =True``
12171219 for violin plots).
1218- medians : bool, optional
1220+ median, medians : bool, optional
12191221 Whether to plot the medians of each column in the input data. If no other
1220- arguments specified, this also sets ``barstds =True`` (and ``boxstds =True``
1222+ arguments specified, this also sets ``barstd =True`` (and ``boxstd =True``
12211223 for violin plots).
12221224 vert : bool, optional
12231225 If ``False``, error data is drawn horizontally rather than vertially. Set
12241226 automatically by methods like `bar`, `barh`, `area`, and `areax`.
12251227 orientation : {{None, 'vertical', 'horizontal'}}, optional
12261228 Alternative to the `vert` keyword arg. If ``'horizontal'``, error data is
12271229 drawn horizontally rather than vertically.
1228- barstds : float, (float, float), or bool, optional
1230+ barstd, barstds : float, (float, float), or bool, optional
12291231 Standard deviation multiples for *thin error bars* with optional whiskers
12301232 (i.e. caps). If scalar, then +/- that number is used. If ``True``, the
12311233 default of +/-3 standard deviations is used. This argument is only valid
12321234 if `means` or `medians` is ``True``.
1233- barpctiles : float, (float, float) or bool, optional
1234- As with `barstds `, but instead using *percentiles* for the error bars. The
1235+ barpctile, barpctiles : float, (float, float) or bool, optional
1236+ As with `barstd `, but instead using *percentiles* for the error bars. The
12351237 percentiles are calculated with `numpy.percentile`. If scalar, that width
12361238 surrounding the 50th percentile is used (e.g. ``90`` shows the 5th to 95th
12371239 percentiles). If ``True``, the default percentile range of 0 to 100 is
@@ -1242,21 +1244,21 @@ def indicate_error(
12421244 points. This should be used if `means` and `medians` are both ``False`` (i.e.
12431245 you did not provide dataset columns from which statistical properties can be
12441246 calculated automatically).
1245- boxstds, boxpctiles, boxdata : optional
1246- As with `barstds `, `barpctiles `, and `bardata`, but for *thicker error bars*
1247+ boxstd, boxstds, boxpctile , boxpctiles, boxdata : optional
1248+ As with `barstd `, `barpctile `, and `bardata`, but for *thicker error bars*
12471249 representing a smaller interval than the thin error bars. If `boxstds` is
12481250 ``True``, the default standard deviation range of +/-1 is used. If `boxpctiles`
12491251 is ``True``, the default percentile range of 25 to 75 is used (i.e. the
12501252 interquartile range). When "boxes" and "bars" are combined, this has the effect
12511253 of drawing miniature box-and-whisker plots.
1252- shadestds, shadepctiles, shadedata : optional
1253- As with `barstds `, `barpctiles `, and `bardata`, but using *shading* to indicate
1254+ shadestd, shadestds, shadepctile , shadepctiles, shadedata : optional
1255+ As with `barstd `, `barpctile `, and `bardata`, but using *shading* to indicate
12541256 the error range. If `shadestds` is ``True``, the default standard deviation
12551257 range of +/-2 is used. If `shadepctiles` is ``True``, the default
12561258 percentile range of 10 to 90 is used. Shading is generally useful for
12571259 `~matplotlib.axes.Axes.plot` plots.
1258- fadestds, fadepctiles, fadedata : optional
1259- As with `shadestds `, `shadepctiles `, and `shadedata`, but for an additional,
1260+ fadestd, fadestds, fadepctile , fadepctiles, fadedata : optional
1261+ As with `shadestd `, `shadepctile `, and `shadedata`, but for an additional,
12601262 more faded, *secondary* shaded region. If `fadestds` is ``True``, the default
12611263 standard deviation range of +/-3 is used. If `fadepctiles` is ``True``,
12621264 the default percentile range of 0 to 100 is used.
@@ -1291,6 +1293,16 @@ def indicate_error(
12911293 bar = name in ('bar' ,)
12921294 violin = name in ('violinplot' ,)
12931295 plot = name in ('plot' , 'scatter' )
1296+ means = _not_none (mean = mean , means = means )
1297+ medians = _not_none (median = median , medians = medians )
1298+ barstds = _not_none (barstd = barstd , barstds = barstds )
1299+ boxstds = _not_none (boxstd = boxstd , boxstds = boxstds )
1300+ shadestds = _not_none (shadestd = shadestd , shadestds = shadestds )
1301+ fadestds = _not_none (fadestd = fadestd , fadestds = fadestds )
1302+ barpctiles = _not_none (barpctile = barpctile , barpctiles = barpctiles )
1303+ boxpctiles = _not_none (boxpctile = boxpctile , boxpctiles = boxpctiles )
1304+ shadepctiles = _not_none (shadepctile = shadepctile , shadepctiles = shadepctiles )
1305+ fadepctiles = _not_none (fadepctile = fadepctile , fadepctiles = fadepctiles )
12941306 bars = any (_ is not None for _ in (bardata , barstds , barpctiles ))
12951307 boxes = any (_ is not None for _ in (boxdata , boxstds , boxpctiles ))
12961308 shade = any (_ is not None for _ in (shadedata , shadestds , shadepctiles ))
0 commit comments