File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 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():
28532853 """
28542854 Initialize the subclassed database.
28552855 """
2856+
28562857 # WARNING: Skip over the matplotlib native duplicate entries
28572858 # 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 hasttr (mcm , prop ):
2874+ return prop
2875+
2876+ attr = get_correct_register ()
28622877 database = getattr (mcm , attr )
28632878 if mcm .get_cmap is not _get_cmap :
28642879 mcm .get_cmap = _get_cmap
You can’t perform that action at this time.
0 commit comments