Skip to content

Commit

Permalink
Merge pull request #75 from MPI-Dortmund/fix-matplotlib-39
Browse files Browse the repository at this point in the history
Fix matplotlib 3.9 issue
  • Loading branch information
thorstenwagner authored Jun 17, 2024
2 parents 1a7ef92 + d4e4dcb commit 41ad867
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 41ad867

Please sign in to comment.