Skip to content

Commit

Permalink
Update figures.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioAPeraza committed May 17, 2024
1 parent 15223b9 commit 58298c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nimare/reports/figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
import pandas as pd
import plotly.express as px
from matplotlib import colormaps
from nilearn import datasets
from nilearn.plotting import (
plot_connectome,
Expand Down Expand Up @@ -211,7 +212,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 = colormaps.get_cmap("tab20", 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 +387,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 = colormaps.get_cmap("tab20", len(clust_ids))

fig = plot_roi(
img,
Expand Down

0 comments on commit 58298c8

Please sign in to comment.