Skip to content

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

@ljw20180420

Description

@ljw20180420

This issue has been discussed in #520. It is fixed in #533.

try:
    from matplotlib.cm import register_cmap
except ImportError:
    from matplotlib.colormaps import register

However, this fix in cooltools/lib/plotting.py does not work for me.

>>> from matplotlib.cm import register_cmap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'register_cmap' from 'matplotlib.cm' (/home/ljw/wuqiang/sx/sx_lcy/.conda/lib/python3.11/site-packages/matplotlib/cm.py)

and

>>> from matplotlib.colormaps import register
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'matplotlib.colormaps'

My package versions are

cooler                    0.10.2             pyhdfd78af_0    bioconda
coolpuppy                 1.1.0              pyh086e186_0    bioconda
cooltools                 0.7.1           py311h1abe8b6_0    bioconda
hic2cool                  1.0.1              pyh7cba7a3_0    bioconda
matplotlib                3.9.3           py311h38be061_0    conda-forge
matplotlib-base           3.9.3           py311h2b939e6_0    conda-forge
matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions