Skip to content

Commit

Permalink
maint: matplotlib has moved the location of the get_cmap function
Browse files Browse the repository at this point in the history
  • Loading branch information
celprov committed Dec 15, 2024
1 parent 33ddfa0 commit 741d51a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/fmri/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import plotly.offline as pyo
import seaborn as sns
from matplotlib.axes import Axes
from matplotlib.cm import get_cmap
from matplotlib.lines import Line2D
from nireports.assembler.report import Report
from nilearn.plotting import plot_design_matrix, plot_matrix
Expand Down Expand Up @@ -109,7 +108,7 @@ def plot_timeseries_carpet(
net_dict = {net: i + 1 for i, net in enumerate(networks_sorted.unique())}
net_plot = np.array([[net_dict[net] for net in networks_sorted]])

net_cmap = get_cmap(NETWORK_CMAP, len(net_dict))
net_cmap = plt.get_cmap(NETWORK_CMAP, len(net_dict))
ax_net.imshow(net_plot.T, cmap=NETWORK_CMAP, aspect="auto")

legend_elements = [
Expand Down Expand Up @@ -207,7 +206,7 @@ def plot_timeseries_signal(
net_dict = {net: i + 1 for i, net in enumerate(networks_sorted.unique())}
net_plot = np.array([[net_dict[net] for net in networks_sorted]])

net_cmap = get_cmap(NETWORK_CMAP, len(net_dict))
net_cmap = plt.get_cmap(NETWORK_CMAP, len(net_dict))

colors = [net_cmap(i - 1) for i in net_plot][0]

Expand Down

0 comments on commit 741d51a

Please sign in to comment.