|
27 | 27 | import pandas as pd |
28 | 28 |
|
29 | 29 | import matplotlib.pyplot as plt |
| 30 | +from matplotlib import colormaps |
30 | 31 | from matplotlib import gridspec as mgs |
31 | 32 | import matplotlib.cm as cm |
32 | 33 | from matplotlib.colors import Normalize |
@@ -200,9 +201,9 @@ def plot_carpet( |
200 | 201 | legend = False |
201 | 202 |
|
202 | 203 | if cmap is None: |
203 | | - colors = cm.get_cmap("tab10").colors |
| 204 | + colors = colormaps["tab10"].colors |
204 | 205 | elif cmap == "paired": |
205 | | - colors = list(cm.get_cmap("Paired").colors) |
| 206 | + colors = list(colormaps["Paired"].colors) |
206 | 207 | colors[0], colors[1] = colors[1], colors[0] |
207 | 208 | colors[2], colors[7] = colors[7], colors[2] |
208 | 209 |
|
@@ -397,7 +398,7 @@ def spikesplot( |
397 | 398 | ntsteps = ts_z.shape[1] |
398 | 399 |
|
399 | 400 | # Load a colormap |
400 | | - my_cmap = cm.get_cmap(cmap) |
| 401 | + my_cmap = colormaps[cmap] |
401 | 402 | norm = Normalize(vmin=0, vmax=float(nslices - 1)) |
402 | 403 | colors = [my_cmap(norm(sl)) for sl in range(nslices)] |
403 | 404 |
|
@@ -525,7 +526,7 @@ def spikesplot_cb(position, cmap="viridis", fig=None): |
525 | 526 | cax = fig.add_axes(position) |
526 | 527 | cb = ColorbarBase( |
527 | 528 | cax, |
528 | | - cmap=cm.get_cmap(cmap), |
| 529 | + cmap=colormaps[cmap], |
529 | 530 | spacing="proportional", |
530 | 531 | orientation="horizontal", |
531 | 532 | drawedges=False, |
|
0 commit comments