-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[MRG] set vmin, vmax after smoothing in plot_epochs_image #3360
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
[MRG] set vmin, vmax after smoothing in plot_epochs_image #3360
Conversation
|
Looks pretty cool. Taking a look later.
|
Current coverage is 86.60%@@ master #3360 diff @@
==========================================
Files 335 335
Lines 57319 57628 +309
Methods 0 0
Messages 0 0
Branches 8713 8721 +8
==========================================
+ Hits 49617 49908 +291
+ Misses 5075 5030 -45
- Partials 2627 2690 +63
|
|
Both this and #3359 are very appreciated. |
|
I don't like the fact that you only use the first image. I would say that if vmin, vmax are not set I see 2 options:
no strong feeling |
|
I prefer option 2 - the code is probably more complex, but IMO same range = least surprise. |
|
I also think I prefer option two. I'll add precomputing smoothed data. |
| evoked = epochs.average(picks) | ||
| data = epochs.get_data()[:, picks, :] | ||
| n_epochs = len(data) | ||
| data = np.swapaxes(data, 0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do the np.swapaxes in one line with epochs.get_data() and then set n_epochs = data.shape[1] if you prefer.
|
@agramfort @jona-sassenhagen @dengemann |
|
thx @mmagnuski |
|
thanks! 🚀 |
|
Thanks Mikolaj! |
* 'master' of git://github.com/mne-tools/mne-python: (48 commits) FIX: Flake fix pep8 [MRG] FIX Topographic plotting for KIT-UMD data (mne-tools#3349) QUICKFIX: logging test Error message for simulate evoked. (mne-tools#3372) Warnings for big bems. (mne-tools#3374) Add test for baseline correction. Use apply_baseline in read_evokeds. Makes (None, 0) the default value baseline in apply_baseline. [FIX] Adds apply_baseline to Evoked fix component inds in ica tutorial (mne-tools#3379) FIX: Xdawn with shuffled epochs (mne-tools#3373) FIX consistency: Epochs.load_data() should always return self (mne-tools#3376) MRG: Build relevant examples (mne-tools#3365) [MRG] set vmin, vmax after smoothing in plot_epochs_image (mne-tools#3360) [FIX] Attempt to fix circle. fixing a bg plotting bug for topo plots Modified test and tutorial. [MRG] convert surface using python. (mne-tools#3273) [MRG] raw.plot_psd() with flat channel (mne-tools#3342) ...
Another small change to

plot_epochs_image- I made it separate from the other PR, because it is not necessarily a bug.Currently
vminandvmaxare set before smoothing (usingsigma) so if one usessigmathe colorscale is not fully used (smoothed data will have lower min and max values etc.).You can see the difference here:
Before:
After:

Now the vmin, vmax are not set based on the whole data, but based on the first smoothed channel (out of those in picks). I could move smoothing out of the figure-loop - so that all picks are smoothed before the loop and vmin, vmax are set based on the whole smoothed data.