From 005b92c01aafcd4876f0cc18a6a41fef170bf344 Mon Sep 17 00:00:00 2001 From: Yarden <58609921+yardenmezi@users.noreply.github.com> Date: Thu, 11 Jul 2024 09:05:23 +0300 Subject: [PATCH] Bug Fix: 'steps' is not a valid value for ls Currently this file doesn't. Error raised is: ValueError: 'steps' is not a valid value for ls; supported values are '-', '--', '-.', ':', 'None', ' ', '', 'solid', 'dashed', 'dashdot', 'dotted' According to https://stackoverflow.com/questions/78025039/matplotlib-valueerror-steps-is-not-a-valid-value-for-ls ls is linestyle, while it seems the intention here is ds - drawstyle --- visbrain/io/write_image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visbrain/io/write_image.py b/visbrain/io/write_image.py index daf91741f..2e6c1acfd 100644 --- a/visbrain/io/write_image.py +++ b/visbrain/io/write_image.py @@ -84,7 +84,7 @@ def write_fig_hyp(data, sf, file=None, start_s=0, grid=False, ascolor=False, plt.xlim(0, len(hypno)) plt.xticks(xticks, xlabels_str) if not ascolor: - plt.plot(hypno, 'k', ls='steps', linewidth=lw) + plt.plot(hypno, 'k', ds='steps', linewidth=lw) else: for k, i in colors.items(): # Quick and dirty switch : @@ -100,7 +100,7 @@ def write_fig_hyp(data, sf, file=None, start_s=0, grid=False, ascolor=False, idxm = np.where(hypno == q)[0] + 1 idxm[idxm >= len(hypno)] = len(hypno) - 1 mask[idxm] = False - plt.plot(np.ma.masked_array(hypno, mask=mask), i, ls='steps', + plt.plot(np.ma.masked_array(hypno, mask=mask), i, ds='steps', linewidth=lw) # Plot REM epochs