@@ -546,13 +546,14 @@ def _auto_format_1d(
546
546
# NOTE: Where columns represent distributions, like for box and violin plots or
547
547
# where we use 'means' or 'medians', columns coords (axis 1) are 'x' coords.
548
548
# 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 )
550
551
if hist :
551
552
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
553
554
else :
554
555
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
556
557
x = _to_arraylike (x )
557
558
558
559
# The labels and XY axis settings
@@ -1185,10 +1186,11 @@ def _get_error_data(
1185
1186
@_deprecate_add_errorbars
1186
1187
def indicate_error (
1187
1188
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 ,
1192
1194
boxmarker = None , boxmarkercolor = 'white' ,
1193
1195
boxcolor = None , barcolor = None , shadecolor = None , fadecolor = None ,
1194
1196
shadelabel = False , fadelabel = False , shadealpha = 0.4 , fadealpha = 0.2 ,
@@ -1211,27 +1213,27 @@ def indicate_error(
1211
1213
----------
1212
1214
*args
1213
1215
The input data.
1214
- means : bool, optional
1216
+ mean, means : bool, optional
1215
1217
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``
1217
1219
for violin plots).
1218
- medians : bool, optional
1220
+ median, medians : bool, optional
1219
1221
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``
1221
1223
for violin plots).
1222
1224
vert : bool, optional
1223
1225
If ``False``, error data is drawn horizontally rather than vertially. Set
1224
1226
automatically by methods like `bar`, `barh`, `area`, and `areax`.
1225
1227
orientation : {{None, 'vertical', 'horizontal'}}, optional
1226
1228
Alternative to the `vert` keyword arg. If ``'horizontal'``, error data is
1227
1229
drawn horizontally rather than vertically.
1228
- barstds : float, (float, float), or bool, optional
1230
+ barstd, barstds : float, (float, float), or bool, optional
1229
1231
Standard deviation multiples for *thin error bars* with optional whiskers
1230
1232
(i.e. caps). If scalar, then +/- that number is used. If ``True``, the
1231
1233
default of +/-3 standard deviations is used. This argument is only valid
1232
1234
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
1235
1237
percentiles are calculated with `numpy.percentile`. If scalar, that width
1236
1238
surrounding the 50th percentile is used (e.g. ``90`` shows the 5th to 95th
1237
1239
percentiles). If ``True``, the default percentile range of 0 to 100 is
@@ -1242,21 +1244,21 @@ def indicate_error(
1242
1244
points. This should be used if `means` and `medians` are both ``False`` (i.e.
1243
1245
you did not provide dataset columns from which statistical properties can be
1244
1246
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*
1247
1249
representing a smaller interval than the thin error bars. If `boxstds` is
1248
1250
``True``, the default standard deviation range of +/-1 is used. If `boxpctiles`
1249
1251
is ``True``, the default percentile range of 25 to 75 is used (i.e. the
1250
1252
interquartile range). When "boxes" and "bars" are combined, this has the effect
1251
1253
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
1254
1256
the error range. If `shadestds` is ``True``, the default standard deviation
1255
1257
range of +/-2 is used. If `shadepctiles` is ``True``, the default
1256
1258
percentile range of 10 to 90 is used. Shading is generally useful for
1257
1259
`~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,
1260
1262
more faded, *secondary* shaded region. If `fadestds` is ``True``, the default
1261
1263
standard deviation range of +/-3 is used. If `fadepctiles` is ``True``,
1262
1264
the default percentile range of 0 to 100 is used.
@@ -1291,6 +1293,16 @@ def indicate_error(
1291
1293
bar = name in ('bar' ,)
1292
1294
violin = name in ('violinplot' ,)
1293
1295
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 )
1294
1306
bars = any (_ is not None for _ in (bardata , barstds , barpctiles ))
1295
1307
boxes = any (_ is not None for _ in (boxdata , boxstds , boxpctiles ))
1296
1308
shade = any (_ is not None for _ in (shadedata , shadestds , shadepctiles ))
0 commit comments