Skip to content

Commit

Permalink
[FIX] Fix calls to matplotlib.cm.get_cmap (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen authored May 22, 2024
1 parent 0f662b5 commit fc406ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clinica/pipelines/machine_learning/ml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def metric_distribution(
"""
# from __future__ import print_function, division

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from matplotlib.backends.backend_pdf import PdfPages

num_repetitions = metric.shape[0]
Expand All @@ -122,7 +122,7 @@ def metric_distribution(
positions=method_ticks,
)

cmap = cm.get_cmap("Paired", num_datasets)
cmap = mpl.colormaps["Paired"].resampled(num_datasets)
for cc, ln in enumerate(line_coll["bodies"]):
ln.set_facecolor(cmap(cc))
ln.set_label(labels[cc])
Expand Down

0 comments on commit fc406ad

Please sign in to comment.