Add option to show a zero line in browser#14018
Conversation
|
The docs error ( The Azure error is also unrelated (hitting 403: rate limit exceeded). |
| initialized. The zero line marks the true zero of each channel's own | ||
| displayed trace, independent of any DC removal or highpass filtering | ||
| already applied to the data. Can be toggled after initialization by |
There was a problem hiding this comment.
Hmm somehow it's hard for me to parse this. I expected at first that hitting "d" would change the position of the line in the plot. I think calling it "true zero" made me think of "where zero actually is for the signal". So maybe
| initialized. The zero line marks the true zero of each channel's own | |
| displayed trace, independent of any DC removal or highpass filtering | |
| already applied to the data. Can be toggled after initialization by | |
| initialized. The zero line marks the centering point of each channel's | |
| **displayed trace**, independent of any DC removal or highpass filtering | |
| already applied to the data. Can be toggled after initialization by |
I wonder if there is value in having a third mode where toggling DC removal changes where the "zero line" is displayed so that it's actually at where the zero level is for that channel (in other words, treating "DC removal" as more of a visual vertical translation rather than a subtraction of any values from the trace)
There was a problem hiding this comment.
Yeah, I thought about that as well. Can you think of a good way to visually distinguish the two modes that show the line? Otherwise it might be confusing if the line doesn't simple toggle when pressing "0".
There was a problem hiding this comment.
Maybe dashed for one (fixed location at the ch_name) and dotted for the other (where true zero is for the signal)?
There was a problem hiding this comment.
Yes, this might work. Or maybe even clearer, dashed for the fixed location and solid for the true zero? True and solid is intuitive I think.
There was a problem hiding this comment.
Sure that works! That way the fixed looks more like an axis line anyway, which is what is basically is at that point
There was a problem hiding this comment.
But does it make sense to show a zero line at the channel midpoint when DC removal is off? Could we couple the zero line to the currently set DC removal?
There was a problem hiding this comment.
I now set the style of the zero line depending on whether DC removal is on or off. If it's off, we show the true zero line as a solid line. When it's on, we show a "virtual" zero line as a dashed line. Yes, if the signal has an actual mean of zero, the virtual mean will be equal to the true mean, but let's not overcomplicate this. Also, the difference between solid and dashed is pretty hard to spot, but I think it looks OK.
This PR adds an option to show a zero line (toggleable with "0") to the Matplotlib backend. I've implemented this feature for the Qt backend in mne-tools/mne-qt-browser#423.
Short example: