Skip to content

Commit

Permalink
bump matplotlib version and update usage of get_cmap
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent committed May 22, 2024
1 parent 0f7446b commit 799571e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nimare/reports/figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def plot_coordinates(
# Generate dictionary and array of colors for each unique ID
ids = coordinates_df["study_id"].to_list()
unq_ids = np.unique(ids)
cmap = plt.cm.get_cmap("tab20", len(unq_ids))
cmap = plt.colormaps["tab20"].resampled(len(unq_ids))
colors_dict = {unq_id: mcolors.to_hex(cmap(i)) for i, unq_id in enumerate(unq_ids)}
colors = [colors_dict[id_] for id_ in ids]

Expand Down Expand Up @@ -386,7 +386,7 @@ def plot_clusters(img, out_filename):

# Define cmap depending on the number of clusters
clust_ids = list(np.unique(img.get_fdata())[1:])
cmap = plt.cm.get_cmap("tab20", len(clust_ids))
cmap = plt.colormaps["tab20"].resampled(len(clust_ids))

fig = plot_roi(
img,
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ install_requires =
fuzzywuzzy # nimare.annotate
jinja2 # nimare.reports
joblib>=1.3.0 # parallelization
matplotlib>=3.5.2 # this is for nilearn, which doesn't include it in its reqs
matplotlib>=3.6.0 # this is for nilearn, which doesn't include it in its reqs
nibabel>=3.2.0 # I/O of niftis
nilearn>=0.10.1,!=0.10.3 # https://github.com/nilearn/nilearn/pull/4256 0.10.3 is broken
numba>=0.57.0 # used by sparse
Expand Down Expand Up @@ -89,7 +89,7 @@ tests =
pytest
pytest-cov
minimum =
matplotlib==3.5.2
matplotlib==3.6.0
nibabel==4.0.0
nilearn==0.10.1
numpy==1.22
Expand Down

0 comments on commit 799571e

Please sign in to comment.