Skip to content

Commit

Permalink
fix matplotlib 3.9 issue (issue #74)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenwagner committed Jun 17, 2024
1 parent 1a7ef92 commit d4e4dcb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/box_manager/io/tloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import typing

import matplotlib
import matplotlib.cm as mcm
import numpy as np
import numpy.typing as npt
Expand Down Expand Up @@ -109,8 +110,12 @@ def to_napari(
napari_type,
)
)
try:
colors = mcm.get_cmap("gist_rainbow")
except AttributeError:
# for matplotlib > 3.9
colors = matplotlib.colormaps["gist_rainbow"]

colors = mcm.get_cmap("gist_rainbow")
n_layers = np.maximum(len(output_dfs), 2) # Avoid zero division

for cidx, (data, kwargs, _) in enumerate(output_dfs):
Expand Down

0 comments on commit d4e4dcb

Please sign in to comment.