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

[FIX] bump matplotlib version and update usage of get_cmap #885

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading