Skip to content

Commit

Permalink
Implement workaround for matplotlib 1.4.2 bug
Browse files Browse the repository at this point in the history
This is an unpleasant hack, but this is also a nasty bug and matplotlib
apparently won't be releasing a fix for a few months:
matplotlib/matplotlib#3699

This closes #344
  • Loading branch information
mwaskom committed Nov 21, 2014
1 parent 7a4da30 commit e0d98c3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/releases/v0.5.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

v0.5.1 (Unreleased)
-------------------

- Implemented a workaround for a bug in matplotlib 1.4.2 that prevented point markers from being drawn when the seaborn styles had been set. See this `github issue <https://github.com/mwaskom/seaborn/issues/344>`_ for more information.

7 changes: 7 additions & 0 deletions seaborn/rcmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@ def plotting_context(context=None, font_scale=1, rc=None):
font_dict = {k: context_dict[k] * font_scale for k in font_keys}
context_dict.update(font_dict)

# Implement hack workaround for matplotlib bug
# See https://github.com/mwaskom/seaborn/issues/344
# There is a bug in matplotlib 1.4.2 that makes points invisible when
# they don't have an edgewidth. It will supposedly be fixed in 1.4.3.
if mpl.__version__ == "1.4.2":
context_dict["lines.markeredgewidth"] = 0.01

# Override these settings with the provided rc dictionary
if rc is not None:
rc = {k: v for k, v in rc.items() if k in _context_keys}
Expand Down
4 changes: 4 additions & 0 deletions seaborn/tests/test_linearmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numpy.testing as npt
import pandas.util.testing as pdt
from numpy.testing.decorators import skipif
from nose import SkipTest

try:
import statsmodels.api as sm
Expand Down Expand Up @@ -943,6 +944,9 @@ def test_lmplot_markers(self):

def test_lmplot_marker_linewidths(self):

if mpl.__version__ == "1.4.2":
raise SkipTest

g = lm.lmplot("x", "y", data=self.df, hue="h",
fit_reg=False, markers=["o", "+"])
c = g.axes[0, 0].collections
Expand Down

0 comments on commit e0d98c3

Please sign in to comment.