Skip to content

Commit

Permalink
Use instead of in ax.plot
Browse files Browse the repository at this point in the history
See matplotlib/matplotlib#4162 for details
on bug in matplotlib on Python 3.4 that motivates this.
  • Loading branch information
mwaskom committed Mar 7, 2015
1 parent 976a767 commit 4b4f300
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions seaborn/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,9 +1195,9 @@ def draw_confints(self, ax, at_group, confint, colors, **kws):
confint,
colors):
if self.orient == "v":
ax.plot([at, at], [ci_low, ci_high], c=color, **kws)
ax.plot([at, at], [ci_low, ci_high], color=color, **kws)
else:
ax.plot([ci_low, ci_high], [at, at], c=color, **kws)
ax.plot([ci_low, ci_high], [at, at], color=color, **kws)


class _BarPlotter(_CategoricalStatPlotter):
Expand Down Expand Up @@ -1316,9 +1316,11 @@ def draw_points(self, ax):
color = self.colors[0]
ls = self.linestyles[0]
if self.orient == "h":
ax.plot(self.statistic, pointpos, c=color, ls=ls, lw=lw)
ax.plot(self.statistic, pointpos,
color=color, ls=ls, lw=lw)
else:
ax.plot(pointpos, self.statistic, c=color, ls=ls, lw=lw)
ax.plot(pointpos, self.statistic,
color=color, ls=ls, lw=lw)

# Draw the confidence intervals
self.draw_confints(ax, pointpos, self.confint, self.colors, lw=lw)
Expand Down Expand Up @@ -1351,10 +1353,10 @@ def draw_points(self, ax):
color = self.colors[j]
ls = self.linestyles[j]
if self.orient == "h":
ax.plot(statistic, offpos, c=color,
ax.plot(statistic, offpos, color=color,
zorder=z, ls=ls, lw=lw)
else:
ax.plot(offpos, statistic, c=color,
ax.plot(offpos, statistic, color=color,
zorder=z, ls=ls, lw=lw)

# Draw the confidence intervals
Expand Down Expand Up @@ -1476,7 +1478,7 @@ def plot(self, ax):
"""),
stripplot=dedent("""\
stripplot : A scatterplot where one variable is categorical. Can be used
in conjunction with a boxplot to show each observation.\
in conjunction with a other plots to show each observation.\
"""),
barplot=dedent("""\
barplot : Show point estimates and confidence intervals using bars.\
Expand Down
1 change: 1 addition & 0 deletions seaborn/tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ def test_draw_cis(self):
p.draw_confints(ax, at_group, confints, colors, lw=4)
line = ax.lines[0]
nt.assert_equal(line.get_linewidth(), 4)

plt.close("all")


Expand Down

0 comments on commit 4b4f300

Please sign in to comment.