Skip to content

Commit 3d3a53b

Browse files
committed
Fix issue where shading fails for horizontal bars
1 parent d50859c commit 3d3a53b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

proplot/axes/plot.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,34 +1337,34 @@ def indicate_error(
13371337
# Draw dark and light shading
13381338
method = kwargs.pop if plot else kwargs.get
13391339
vert = method('vert', method('orientation', 'vertical') == 'vertical')
1340-
method = self.fill_between if vert else self.fill_betweenx
1341-
ex, ey = (x, y) if vert else (y, x)
13421340
eobjs = []
1341+
method = self.fill_between if vert else self.fill_betweenx
13431342
if fade:
13441343
edata, label = _get_error_data(
1345-
data, ey, errdata=fadedata, stds=fadestds, pctiles=fadepctiles,
1344+
data, y, errdata=fadedata, stds=fadestds, pctiles=fadepctiles,
13461345
stds_default=(-3, 3), pctiles_default=(0, 100), absolute=True,
13471346
reduced=means or medians, label=fadelabel,
13481347
)
13491348
eobj = method(
1350-
ex, *edata, linewidth=0, label=label,
1349+
x, *edata, linewidth=0, label=label,
13511350
color=fadecolor, alpha=fadealpha, zorder=fadezorder,
13521351
)
13531352
eobjs.append(eobj)
13541353
if shade:
13551354
edata, label = _get_error_data(
1356-
data, ey, errdata=shadedata, stds=shadestds, pctiles=shadepctiles,
1355+
data, y, errdata=shadedata, stds=shadestds, pctiles=shadepctiles,
13571356
stds_default=(-2, 2), pctiles_default=(10, 90), absolute=True,
13581357
reduced=means or medians, label=shadelabel,
13591358
)
13601359
eobj = method(
1361-
ex, *edata, linewidth=0, label=label,
1360+
x, *edata, linewidth=0, label=label,
13621361
color=shadecolor, alpha=shadealpha, zorder=shadezorder,
13631362
)
13641363
eobjs.append(eobj)
13651364

13661365
# Draw thin error bars and thick error boxes
1367-
axis = 'y' if vert else 'x' # yerr
1366+
sy = 'y' if vert else 'x' # yerr
1367+
ex, ey = (x, y) if vert else (y, x)
13681368
if boxes:
13691369
edata, _ = _get_error_data(
13701370
data, y, errdata=boxdata, stds=boxstds, pctiles=boxpctiles,
@@ -1377,7 +1377,7 @@ def indicate_error(
13771377
)
13781378
eobj = self.errorbar(
13791379
ex, ey, color=boxcolor, linewidth=boxlinewidth, linestyle='none',
1380-
capsize=0, zorder=boxzorder, **{axis + 'err': edata}
1380+
capsize=0, zorder=boxzorder, **{sy + 'err': edata}
13811381
)
13821382
eobjs.append(eobj)
13831383
if bars: # now impossible to make thin bar width different from cap width!
@@ -1389,7 +1389,7 @@ def indicate_error(
13891389
eobj = self.errorbar(
13901390
ex, ey, color=barcolor, linewidth=barlinewidth, linestyle='none',
13911391
markeredgecolor=barcolor, markeredgewidth=barlinewidth,
1392-
capsize=capsize, zorder=barzorder, **{axis + 'err': edata}
1392+
capsize=capsize, zorder=barzorder, **{sy + 'err': edata}
13931393
)
13941394
eobjs.append(eobj)
13951395

0 commit comments

Comments
 (0)