-
Notifications
You must be signed in to change notification settings - Fork 51
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
Neither from matplotlib.cm import register_cmap
nor from matplotlib.colormaps import register
works in cooltools 0.7.1 for supporting matplotlib 3.9
#544
Comments
Can you please double check you are using the versions that you think you are using? Can you check the output of matplotlib.version and cooltools.version in the interactive python prompt where you tried running the code? |
Python 3.11.10 | packaged by conda-forge | (main, Oct 16 2024, 01:27:36) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'3.9.3'
>>> import cooltools
>>> cooltools.__version__
'0.7.1'
>>> I use conda. Does that matter? |
Hi, This was built using the conda environment built from the quaich program template/yaml file they provided. Some of the downstream tools must still reference deprecated calls to matplotlib that are now gone in 3.9.3. |
I can confirm, for a fresh installation today:
|
I modified the code and it works now. try:
from matplotlib.cm import register_cmap
except ImportError:
from matplotlib import colormaps
# from matplotlib.colormaps import register
def _register_cmaps():
for name, pal in PALETTES.items():
colormaps.register(list_to_colormap(pal), name=name)
colormaps.register(list_to_colormap(pal[::-1]), name=name + '_r')
# register_cmap(name, list_to_colormap(pal))
# register_cmap(name + "_r", list_to_colormap(pal[::-1]))
|
Will the fix be merged to version 0.7.2? |
This issue has been discussed in #520. It is fixed in #533.
However, this fix in
cooltools/lib/plotting.py
does not work for me.and
My package versions are
The text was updated successfully, but these errors were encountered: