diff --git a/WHATSNEW.rst b/WHATSNEW.rst index 9bfd63ddc..71e5d70d6 100644 --- a/WHATSNEW.rst +++ b/WHATSNEW.rst @@ -272,6 +272,15 @@ Documentation * Improve colorbar and legend documentation, expound added features more carefully (:commit:`43631840`). +Version 0.9.8 (2024-03-XX) +========================== + +Compatibility +------------- + +* Use more flexible reference to ``_cmap_registry`` to support ``matplotlib>=3.6.0`` (:commit:`15a4439`). +* Try multiple import routes to reference ``fontconfig_pattern`` to support up to ``matplotlib==3.8.3`` (:commit:`f003419`). + Version 0.9.5 (2021-10-19) ========================== diff --git a/proplot/axes/base.py b/proplot/axes/base.py index ae55d19d4..46bc003e5 100644 --- a/proplot/axes/base.py +++ b/proplot/axes/base.py @@ -1140,6 +1140,12 @@ def _add_colorbar( elif isinstance(ticker, mticker.TickHelper): ticker.set_axis(axis) + if _version_mpl >= '3.6': + print("minorlocator is None, mpl >= 3.6 fix set it to MultipleLocator") + if minorlocator is None: + from matplotlib.ticker import AutoLocator + minorlocator = AutoLocator() + # Create colorbar and update ticks and axis direction # NOTE: This also adds the guides._update_ticks() monkey patch that triggers # updates to DiscreteLocator when parent axes is drawn. diff --git a/proplot/colors.py b/proplot/colors.py index dfc39bd80..0a22c3ec7 100644 --- a/proplot/colors.py +++ b/proplot/colors.py @@ -2758,8 +2758,12 @@ def _init_cmap_database(): """ # WARNING: Skip over the matplotlib native duplicate entries # with suffixes '_r' and '_shifted'. - attr = '_cmap_registry' if hasattr(mcm, '_cmap_registry') else 'cmap_d' - database = getattr(mcm, attr) + try: + database = mcm._gen_cmap_registry() + attr = '_cmap_registry' # Need to set this for legacy support. + except AttributeError: # older versions that don't have getter for registry. + attr = '_cmap_registry' if hasattr(mcm, '_cmap_registry') else 'cmap_d' + database = getattr(mcm, attr) if mcm.get_cmap is not _get_cmap: mcm.get_cmap = _get_cmap if mcm.register_cmap is not _register_cmap: diff --git a/proplot/internals/rcsetup.py b/proplot/internals/rcsetup.py index 105f219f3..851d83bde 100644 --- a/proplot/internals/rcsetup.py +++ b/proplot/internals/rcsetup.py @@ -14,7 +14,11 @@ from matplotlib import rcParamsDefault as _rc_matplotlib_native from matplotlib.colors import Colormap from matplotlib.font_manager import font_scalings -from matplotlib.fontconfig_pattern import parse_fontconfig_pattern + +try: + from matplotlib.fontconfig_pattern import parse_fontconfig_pattern +except ModuleNotFoundError: # 3.8.0 and higher got rid of the public module. + from matplotlib._fontconfig_pattern import parse_fontconfig_pattern from . import ic # noqa: F401 from . import warnings @@ -45,7 +49,7 @@ CYCLE = 'colorblind' CMAPCYC = 'twilight' CMAPDIV = 'BuRd' -CMAPSEQ = 'Fire' +CMAPSEQ = 'Viridis' CMAPCAT = 'colorblind10' DIVERGING = 'div' FRAMEALPHA = 0.8 # legend and colorbar diff --git a/setup.cfg b/setup.cfg index 8b422f223..5df96d36a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ project_urls = [options] packages = proplot install_requires = - matplotlib>=3.0.0,<3.6.0 + matplotlib>=3.0.0 numpy include_package_data = True python_requires = >=3.6.0