gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
592 stars 138 forks source link

FIX avoid registering the same colormap twice to matplotlib #464

Closed TomDLT closed 2 years ago

TomDLT commented 2 years ago

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:

I tested the fix with matplotlib 3.3 and 3.6.