Skip to content

Commit

Permalink
restore compat with matplotlib <= 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Sep 17, 2021
1 parent 5b27b6d commit cb12c94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yt/visualization/plot_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from matplotlib.cm import get_cmap
from matplotlib.font_manager import FontProperties
from more_itertools.more import always_iterable
from packaging.version import Version

from yt._maintenance.deprecation import issue_deprecation_warning
from yt.config import ytcfg
Expand All @@ -22,6 +23,7 @@

from ._commons import validate_image_name

MPL_VERSION = Version(matplotlib.__version__)
try:
import cmocean
except ImportError:
Expand Down Expand Up @@ -239,13 +241,15 @@ def __init__(self, data_source, default_factory=None):

_DEFAULT_FONT_PROPERTIES = {
"family": "stixgeneral",
"math_fontfamily": "cm",
"size": 18,
"fname": os.path.join(
matplotlib.get_data_path(), "fonts", "ttf", "STIXGeneral.ttf"
),
}

if MPL_VERSION >= Version("3.4"):
_DEFAULT_FONT_PROPERTIES["math_fontfamily"] = "cm"


class PlotContainer:
"""A container for generic plots"""
Expand Down

0 comments on commit cb12c94

Please sign in to comment.