From 58298c8ab0a6720c570318014212fa42891d5aa8 Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Fri, 17 May 2024 15:58:50 -0700 Subject: [PATCH] Update figures.py --- nimare/reports/figures.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nimare/reports/figures.py b/nimare/reports/figures.py index b5e7f3353..d8ad66aba 100644 --- a/nimare/reports/figures.py +++ b/nimare/reports/figures.py @@ -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, @@ -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] @@ -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,