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

MNT: Fix deprectation error in CI #866

Merged
merged 1 commit into from
Apr 17, 2024
Merged
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
9 changes: 5 additions & 4 deletions niworkflows/viz/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import pandas as pd

import matplotlib.pyplot as plt
from matplotlib import colormaps
from matplotlib import gridspec as mgs
import matplotlib.cm as cm
from matplotlib.colors import Normalize
Expand Down Expand Up @@ -200,9 +201,9 @@ def plot_carpet(
legend = False

if cmap is None:
colors = cm.get_cmap("tab10").colors
colors = colormaps["tab10"].colors
elif cmap == "paired":
colors = list(cm.get_cmap("Paired").colors)
colors = list(colormaps["Paired"].colors)
colors[0], colors[1] = colors[1], colors[0]
colors[2], colors[7] = colors[7], colors[2]

Expand Down Expand Up @@ -397,7 +398,7 @@ def spikesplot(
ntsteps = ts_z.shape[1]

# Load a colormap
my_cmap = cm.get_cmap(cmap)
my_cmap = colormaps[cmap]
norm = Normalize(vmin=0, vmax=float(nslices - 1))
colors = [my_cmap(norm(sl)) for sl in range(nslices)]

Expand Down Expand Up @@ -525,7 +526,7 @@ def spikesplot_cb(position, cmap="viridis", fig=None):
cax = fig.add_axes(position)
cb = ColorbarBase(
cax,
cmap=cm.get_cmap(cmap),
cmap=colormaps[cmap],
spacing="proportional",
orientation="horizontal",
drawedges=False,
Expand Down
Loading