Skip to content

Commit

Permalink
change other instances of get_cmap
Browse files Browse the repository at this point in the history
  • Loading branch information
danibene committed May 19, 2024
1 parent 36fc948 commit 5532779
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion neurokit2/events/events_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def events_plot(events, signal=None, color="red", linestyle="--"):
else:
# Convert color and style to list
if isinstance(color, str):
color_map = matplotlib.cm.get_cmap("rainbow")
color_map = plt.get_cmap("rainbow")
color = color_map(np.linspace(0, 1, num=len(events)))
if isinstance(linestyle, str):
linestyle = np.full(len(events), linestyle)
Expand Down
2 changes: 1 addition & 1 deletion neurokit2/microstates/microstates_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def microstates_plot(microstates, segmentation=None, gfp=None, info=None, epoch=
if epoch is None:
epoch = (0, len(gfp))

cmap = plt.cm.get_cmap("plasma", n)
cmap = plt.get_cmap("plasma")(np.linspace(0, 1, n))
# Plot the GFP line above the area
ax["GFP"].plot(
times[epoch[0] : epoch[1]], gfp[epoch[0] : epoch[1]], color="black", linewidth=0.5
Expand Down
2 changes: 1 addition & 1 deletion neurokit2/signal/signal_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _signal_power_instant_plot(psd, out, frequency_band, ax=None):
labels = [f"{i[1]}-{i[2]} Hz" for i in labels]

# Get cmap
cmap = matplotlib.cm.get_cmap("Set1")
cmap = plt.get_cmap("Set1")
colors = cmap.colors
colors = (
colors[3],
Expand Down

0 comments on commit 5532779

Please sign in to comment.