File tree 1 file changed +19
-4
lines changed
1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -2853,12 +2853,27 @@ def _init_cmap_database():
2853
2853
"""
2854
2854
Initialize the subclassed database.
2855
2855
"""
2856
+
2856
2857
# WARNING: Skip over the matplotlib native duplicate entries
2857
2858
# with suffixes '_r' and '_shifted'.
2858
- for prop in ["_cmap_registry" , "cmap_d" , "_colormaps" ]:
2859
- if hasattr (mcm , prop ):
2860
- attr = prop
2861
- break
2859
+ def get_correct_register (
2860
+ props = [
2861
+ "_cmap_registry" ,
2862
+ "cmap_d" ,
2863
+ "_colormaps" ,
2864
+ ]
2865
+ ):
2866
+ # In matplotlib.cm as register is made under
2867
+ # _colormaps (as of 3.9.1). It seems like they are
2868
+ # moving towards using ColormapRegister as a static class
2869
+ # so this may change in the future. This piece of code
2870
+ # is to ensure that the correct object is used
2871
+ # to register proplots colormaps
2872
+ for prop in props :
2873
+ if hasattr (mcm , prop ):
2874
+ return prop
2875
+
2876
+ attr = get_correct_register ()
2862
2877
database = getattr (mcm , attr )
2863
2878
if mcm .get_cmap is not _get_cmap :
2864
2879
mcm .get_cmap = _get_cmap
You can’t perform that action at this time.
0 commit comments