From 15a4439f34a7e700ae7ba6ca59c5e5943c5331e1 Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Tue, 5 Mar 2024 13:42:40 -0700 Subject: [PATCH 1/8] fix cmap registry for support at matplotlib 3.6.0 and higher --- proplot/colors.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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: From 261fcd0a11a6bc93c5b1d786df0b75456144da49 Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Tue, 5 Mar 2024 13:47:11 -0700 Subject: [PATCH 2/8] update changelog --- WHATSNEW.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WHATSNEW.rst b/WHATSNEW.rst index 9bfd63ddc..498f98254 100644 --- a/WHATSNEW.rst +++ b/WHATSNEW.rst @@ -272,6 +272,14 @@ Documentation * Improve colorbar and legend documentation, expound added features more carefully (:commit:`43631840`). +Version 0.9.7 (2024-03-XX) +========================== + +Compatibility +------------- + +* Update references on ``proplot`` import to support ``matplotlib>=3.6.0`` (:commit:`15a4439`). + Version 0.9.5 (2021-10-19) ========================== From f00341939c28ef6d51084d71f91adfecb06161ad Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Tue, 5 Mar 2024 13:53:25 -0700 Subject: [PATCH 3/8] update fontconfig imports to support up to 3.8.3 --- proplot/internals/rcsetup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proplot/internals/rcsetup.py b/proplot/internals/rcsetup.py index 105f219f3..9a31113a3 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 From 7cd57295c9f7d6fa3e28d489e748c6907a68270d Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Tue, 5 Mar 2024 13:55:19 -0700 Subject: [PATCH 4/8] update changelog --- WHATSNEW.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATSNEW.rst b/WHATSNEW.rst index 498f98254..be03863ad 100644 --- a/WHATSNEW.rst +++ b/WHATSNEW.rst @@ -278,7 +278,8 @@ Version 0.9.7 (2024-03-XX) Compatibility ------------- -* Update references on ``proplot`` import to support ``matplotlib>=3.6.0`` (:commit:`15a4439`). +* 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) ========================== From 8d8be974d52697abeab940fcec5666a24138a276 Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Tue, 5 Mar 2024 14:15:21 -0700 Subject: [PATCH 5/8] drop upper bound on matplotlib --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c0bf6b6b8ec047e302eea78631942467575e75cb Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Tue, 5 Mar 2024 14:19:30 -0700 Subject: [PATCH 6/8] fix version number on changelog --- WHATSNEW.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WHATSNEW.rst b/WHATSNEW.rst index be03863ad..71e5d70d6 100644 --- a/WHATSNEW.rst +++ b/WHATSNEW.rst @@ -272,7 +272,7 @@ Documentation * Improve colorbar and legend documentation, expound added features more carefully (:commit:`43631840`). -Version 0.9.7 (2024-03-XX) +Version 0.9.8 (2024-03-XX) ========================== Compatibility From 68b6fb04d23074a28eafdd35f3b21f91901b67b3 Mon Sep 17 00:00:00 2001 From: Miha Cernetic Date: Thu, 16 May 2024 15:55:33 -0400 Subject: [PATCH 7/8] fix minorticklocator being None for mpl >= 3.6.0 --- proplot/axes/base.py | 6 ++++++ 1 file changed, 6 insertions(+) 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. From 9dd9be10fb1eb61359bdc15c9bbfa2c69ec25c5a Mon Sep 17 00:00:00 2001 From: Riley Brady Date: Sat, 29 Jun 2024 09:58:49 -0600 Subject: [PATCH 8/8] update default colormap to Viridis from Fire --- proplot/internals/rcsetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proplot/internals/rcsetup.py b/proplot/internals/rcsetup.py index 9a31113a3..851d83bde 100644 --- a/proplot/internals/rcsetup.py +++ b/proplot/internals/rcsetup.py @@ -49,7 +49,7 @@ CYCLE = 'colorblind' CMAPCYC = 'twilight' CMAPDIV = 'BuRd' -CMAPSEQ = 'Fire' +CMAPSEQ = 'Viridis' CMAPCAT = 'colorblind10' DIVERGING = 'div' FRAMEALPHA = 0.8 # legend and colorbar