Pycortex raises an error with matplotlib 3.6, when it tries to register the same colormap twice. This is because the check if self.cmap not in cm.__dict__ does not work anymore. (See recent changes to the colormaps API in matplotlib here)
This PR:
fixes how to check that the colormap is already registered
refactors duplicated code into a new method get_cmapdict in Dataview and DataviewRGB
Pycortex raises an error with matplotlib 3.6, when it tries to register the same colormap twice. This is because the check
if self.cmap not in cm.__dict__
does not work anymore. (See recent changes to the colormaps API in matplotlib here)This PR:
get_cmapdict
inDataview
andDataviewRGB
I tested the fix with matplotlib 3.3 and 3.6.