Skip to content

Conversation

@TomDLT
Copy link
Contributor

@TomDLT TomDLT commented Sep 16, 2022

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
  • add a test for clarity

I tested the fix with matplotlib 3.3 and 3.6.

Copy link
Contributor

@mvdoc mvdoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TomDLT TomDLT merged commit b134110 into gallantlab:main Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants