-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stairs plot #108
Stairs plot #108
Conversation
Note that I only used |
@remrama you're amazing!!
|
And edit the changelog please! Version |
No problem! wrt the |
Agreed, good idea! |
Codecov ReportBase: 91.41% // Head: 91.43% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #108 +/- ##
==========================================
+ Coverage 91.41% 91.43% +0.02%
==========================================
Files 22 22
Lines 2690 2674 -16
==========================================
- Hits 2459 2445 -14
+ Misses 231 229 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Should be good now @raphaelvallat! Attaching a figure that should show up during docs, or did you want the actual docs-generated one? A few notes:
|
Awesome, looks great! I'll do an in-depth review of the code soon. FYI there are unit tests for the plot_spectrogram function: yasa/yasa/tests/test_spectral.py Lines 152 to 169 in 399d984
|
Hi @remrama, Quick question: When using import numpy
import yasa
import matplotlib.pyplot as plt
hypno = 100 * [-2] + list(np.repeat([-0, 0, -1, -1, 0, 0, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 0, 0, 0], 120)) + 100 * [-2]
_, ax = plt.subplots(1, 1, figsize=(9, 4))
yasa.plot_hypnogram(hypno, sf_hypno=1/10, lw=1.5, fill_color="gainsboro"); That said I don't have a strong preference here. |
Also, do you have a preference for using plt.figure(figsize=(7, 3), constrained_layout=True)
ax = yasa.plot_hypnogram(hypno, fill_color="gainsboro") or fig, ax = plt.subplots(1, 1, figsize=(7, 3))
yasa.plot_hypnogram(hypno, fill_color="gainsboro", ax=ax) |
Good call on the Art/Uns. There was a simple fix, clipping the hypno to only wake+ epochs when passing to the wrt returning |
Perfect! Almost there, I just added one last comment re: order of the code. Thanks again! |
K pushed up that change. btw, I didn't do any rebasing/merging with master (1 commit behind). I figure you can handle that in this instance, but for future reference, do you have a preference on whether I should rebase vs merge |
Rebase whenever possible. Thanks so much again, merging now! |
bf89ed8
to
7a10187
Compare
Makes a minor adjustment to the underlying
yasa.plot_hypnogram
code. The hypnogram line is now drawn using a combination ofplt.stairs
andplt.hlines
instead ofplt.step
. See Issue #106 for motivation behind this change.Also adds a
fill_color
argumentyasa.plot_hypnogram
for an optional solid-color fill above the hypnogram line. Default value (None
) will not draw filling.