Skip to content

Conversation

@Aditya-Bajra
Copy link

Problem:

In the original code of run.py, the line:
cmap = matplotlib.colormaps.get_cmap('Spectral_r')

was causing the following error:
AttributeError: 'ColormapRegistry' object has no attribute 'get_cmap'

This error occurs because in newer versions of matplotlib, the method for retrieving colormaps has changed.

Solution:

Replaced matplotlib.colormaps.get_cmap('Spectral_r') with plt.get_cmap('Spectral_r'), which is the correct method to access colormaps in matplotlib.

Impact:

This change ensures compatibility with newer versions of matplotlib and resolves the AttributeError

Fix AttributeError in ColormapRegistry: add get_cmap method
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.

1 participant