From 63b46f89a872b6961a5ce295f438590ca5480752 Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Tue, 14 Jun 2022 20:56:21 -0400 Subject: [PATCH] Allow align= to sneak through in barplot (but ignore CIs for now) --- seaborn/categorical.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/seaborn/categorical.py b/seaborn/categorical.py index 3e24eddaed..f01f10c440 100644 --- a/seaborn/categorical.py +++ b/seaborn/categorical.py @@ -1597,11 +1597,14 @@ def draw_bars(self, ax, kws): barfunc = ax.bar if self.orient == "v" else ax.barh barpos = np.arange(len(self.statistic)) + kws = kws.copy() + kws.setdefault("align", "center") + if self.plot_hues is None: # Draw the bars barfunc(barpos, self.statistic, self.width, - color=self.colors, align="center", **kws) + color=self.colors, **kws) # Draw the confidence intervals errcolors = [self.errcolor] * len(barpos) @@ -1619,7 +1622,7 @@ def draw_bars(self, ax, kws): # Draw the bars offpos = barpos + self.hue_offsets[j] barfunc(offpos, self.statistic[:, j], self.nested_width, - color=self.colors[j], align="center", + color=self.colors[j], label=hue_level, **kws) # Draw the confidence intervals