Skip to content

Commit

Permalink
Further fix for deprecated mpl rcParams (#3058)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Oct 7, 2018
1 parent 8490fb8 commit 0afb831
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions holoviews/plotting/mpl/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from ..renderer import Renderer, MIME_TYPES, HTML_TAGS
from .widgets import MPLSelectionWidget, MPLScrubberWidget
from .util import get_tight_bbox
from .util import get_tight_bbox, mpl_version

class OutputWarning(param.Parameterized):pass
outputwarning = OutputWarning(name='Warning')
Expand Down Expand Up @@ -275,8 +275,12 @@ def _compute_bbox(self, fig, kw):
@classmethod
@contextmanager
def state(cls):
deprecated = ['text.latex.unicode', 'examples.directory']
old_rcparams = {k: mpl.rcParams[k] for k in mpl.rcParams.keys()
if mpl_version < '3.0' or k not in deprecated}

try:
cls._rcParams = dict(mpl.rcParams)
cls._rcParams = old_rcparams
yield
finally:
mpl.rcParams.clear()
Expand Down

0 comments on commit 0afb831

Please sign in to comment.