Skip to content

Commit

Permalink
use "resampled" matplotlib/matplotlib#20853
Browse files Browse the repository at this point in the history
  • Loading branch information
danibene committed May 19, 2024
1 parent dcc9d08 commit 4a4b658
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion neurokit2/complexity/entropy_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def entropy_phase(signal, delay=1, k=4, show=False, **kwargs):
Tx = Tx.astype(bool)
Ys = np.sin(angles) * limx * np.sqrt(2)
Xs = np.cos(angles) * limx * np.sqrt(2)
colors = plt.get_cmap("jet")(np.linspace(0, 1, k))
colors = plt.get_cmap("jet").resampled(k)

plt.figure()
for i in range(k):
Expand Down
2 changes: 1 addition & 1 deletion neurokit2/hrv/hrv_nonlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def _hrv_nonlinear_show(rri, rri_time=None, rri_missing=False, out={}, ax=None,
kernel = scipy.stats.gaussian_kde(values)
f = np.reshape(kernel(positions).T, xx.shape)

cmap = plt.get_cmap("Blues")(np.linspace(0, 1, 10))
cmap = plt.get_cmap("Blues").resampled(10)
ax.contourf(xx, yy, f, cmap=cmap)
ax.imshow(np.rot90(f), extent=[ax1_min, ax1_max, ax2_min, ax2_max], aspect="auto")

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.get_cmap("plasma")(np.linspace(0, 1, n))
cmap = plt.get_cmap("plasma").resampled(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

0 comments on commit 4a4b658

Please sign in to comment.