Skip to content

Commit

Permalink
depr warning mpl
Browse files Browse the repository at this point in the history
  • Loading branch information
BalzaniEdoardo committed Feb 10, 2025
1 parent a304bc6 commit 1c9e04b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/scripts/glm_predictors.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def plot_custom_features():

# Plot stacked signals
plt.figure(figsize=(12, 4))
cmap = plt.cm.get_cmap("rainbow")
cmap = plt.colormaps["rainbow"]
colors = cmap(np.linspace(0, 1, num_signals))

ax = plt.subplot(111)
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/plot_03_grid_cells.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ corresponding position. Let's plot 5 time steps.
fig = plt.figure(figsize=(12, 4))
gs = plt.GridSpec(2, 5)
xt = np.arange(0, 1000, 200)
cmap = plt.get_cmap("rainbow")
cmap = plt.colormaps["rainbow"]
colors = np.linspace(0, 1, len(xt))
for cnt, i in enumerate(xt):
ax = plt.subplot(gs[0, i // 200])
Expand Down
10 changes: 5 additions & 5 deletions src/nemos/_documentation_utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def current_injection_plot(
# define plotting parameters
# colormap, color levels and transparency level
# for the current injection epochs
cmap = plt.get_cmap("autumn")
cmap = plt.colormaps["autumn"]
color_levs = [0.8, 0.5, 0.2]
alpha = 0.4

Expand Down Expand Up @@ -508,7 +508,7 @@ def plot_coupling(
cmap_label="hsv",
):
pref_ang = tuning.idxmax()
cmap_tun = plt.get_cmap(cmap_label)
cmap_tun = plt.colormaps[cmap_label]
color_tun = (pref_ang.values - pref_ang.values.min()) / (
pref_ang.values.max() - pref_ang.values.min()
)
Expand All @@ -522,7 +522,7 @@ def plot_coupling(
# scale to 0,1
color = -0.5 * (sum_resp_n - sum_resp_n.min()) / sum_resp_n.min()

cmap = plt.get_cmap(cmap_name)
cmap = plt.colormaps[cmap_name]
n_row, n_col, n_tp = responses.shape
time = np.arange(n_tp)
fig, axs = plt.subplots(n_row + 1, n_col + 1, figsize=figsize, sharey="row")
Expand Down Expand Up @@ -825,7 +825,7 @@ def plot_head_direction_tuning(
)

# plot raster and heading
cmap = plt.get_cmap(cmap_label)
cmap = plt.colormaps[cmap_label]
unq_angles = np.unique(pref_ang.values)
n_subplots = len(unq_angles)
relative_color_levs = (unq_angles - unq_angles[0]) / (
Expand Down Expand Up @@ -930,7 +930,7 @@ def plot_head_direction_tuning_model(
)

# plot raster and heading
cmap = plt.get_cmap(cmap_label)
cmap = plt.colormaps[cmap_label]
unq_angles = np.unique(pref_ang.values)
n_subplots = len(unq_angles)
relative_color_levs = (unq_angles - unq_angles[0]) / (
Expand Down

0 comments on commit 1c9e04b

Please sign in to comment.