Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AttributeError in ColormapRegistry #223

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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