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

pin matplotlib version? #74

Closed
azazellochg opened this issue Jun 16, 2024 · 2 comments · Fixed by #75
Closed

pin matplotlib version? #74

azazellochg opened this issue Jun 16, 2024 · 2 comments · Fixed by #75

Comments

@azazellochg
Copy link

The box manager fails with the latest matplotlib 3.9.0:

  File "/home/gsharov/soft/miniconda3/envs/napari-0.4.17/lib/python3.10/site-packages/box_manager/io/tloc.py", line 113, in to_napari
    colors = mcm.get_cmap("gist_rainbow")
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

Cause: https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#top-level-cmap-registration-and-access-functions-in-mpl-cm

Suggestion: pin matplotlib version to 3.8.4 in conda_env.yml

@thorstenwagner
Copy link
Contributor

Hi!

Thanks for letting me know. I would rather prefer to fix the problem by

    try:
        colors = mcm.get_cmap("gist_rainbow")
    except AttributeError:
        # for matplotlib > 3.9
        colors = matplotlib.colormaps["gist_rainbow"]

I tested it and it works :-)

@thorstenwagner
Copy link
Contributor

Fixed with version 0.4.12! Thanks again!

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.

2 participants