From 0afb831c83c6166187ffc989354d0373ecb689d9 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sun, 7 Oct 2018 18:09:04 +0100 Subject: [PATCH] Further fix for deprecated mpl rcParams (#3058) --- holoviews/plotting/mpl/renderer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/holoviews/plotting/mpl/renderer.py b/holoviews/plotting/mpl/renderer.py index c84d75c586..a8131ccd6c 100644 --- a/holoviews/plotting/mpl/renderer.py +++ b/holoviews/plotting/mpl/renderer.py @@ -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') @@ -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()