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

Matplotlib warnings in seaborn example: "Trying to register the cmap which already exists" #968

Closed
lesteve opened this issue Jul 8, 2022 · 0 comments · Fixed by #969
Closed

Comments

@lesteve
Copy link
Member

lesteve commented Jul 8, 2022

Seen in scikit-learn: scikit-learn/scikit-learn#23828

/home/circleci/miniconda/envs/testenv/lib/python3.9/site-packages/seaborn/cm.py:1582: UserWarning: Trying to register the cmap 'rocket' which already exists.
  mpl_cm.register_cmap(_name, _cmap)

Googling for the error does turn up other projects that are affected. I think this is because the reset_seaborn logic by removing the seaborn modules from sys.modules, triggers colormaps registration multiple times if seaborn is used in multiple examples. It seems like using seaborn.reset_defaults could be used instead the sys.modules removal.

I have opened #969 to use seaborn.reset_defaults and see what happens.

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 a pull request may close this issue.

1 participant