Skip to content

WIP: Refactor raw and epochs plotting, add butterfly and group_by kwargs - #4972

Closed
larsoner wants to merge 6 commits into
mne-tools:masterfrom
larsoner:groupby
Closed

larsoner wants to merge 6 commits into
mne-tools:masterfrom
larsoner:groupby

Conversation

@larsoner

@larsoner larsoner commented Feb 27, 2018 •

Copy link
Copy Markdown
Member

Looking at mne/viz/raw.py and mne/viz/epochs.py there appears to be a lot of duplicated code in terms of 1) plot setup, 2) key press handling, and 3) butterfly setup. At the same time, epochs.plot is less capable than raw.plot in terms of (at least) butterfly and group_by options. This PR aims to fix this.

Todo:

  • make epochs.plot(butterfly=True) work and add test (easy)
  • wait for MRG: Add whitening to plots #4799 to be merged to avoid bad conflicts
  • fix epochs params['offsets'] use
  • fix labels for whitened data in butterfly mode
  • make epochs.plot(group_by='type') work
  • fix raw.plot(group_by='selection')
  • Unify types in setup functions
  • Unify _setup_butterfly
  • Unify onscroll
  • Unify onkey
  • implement epochs.plot(group_by='selection')
  • add tests for group_by
  • fix ICA plotting breakages, if any

Closes #4850.

@codecov

codecov Bot commented Feb 27, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #4972 into master will decrease coverage by 21.58%.
The diff coverage is 48.92%.

@@             Coverage Diff             @@
##           master    #4972       +/-   ##
===========================================
- Coverage    87.9%   66.31%   -21.59%     
===========================================
  Files         353      353               
  Lines       63337    63220      -117     
  Branches    10834    10812       -22     
===========================================
- Hits        55674    41924    -13750     
- Misses       4913    18865    +13952     
+ Partials     2750     2431      -319

@larsoner

Copy link
Copy Markdown
Member Author

So the raw butterfly mode to me looks better than the epochs butterfly mode (I haven't changed this behavior yet):

https://7066-1301584-gh.circle-artifacts.com/0/tmp/circle-artifacts.CtE6jQa/html/auto_tutorials/plot_whitened.html

Any objections with unifying these to plot the same way, and plot the way it's done for raw data?

@agramfort

agramfort commented Feb 28, 2018 via email

Copy link
Copy Markdown
Member

@larsoner

Copy link
Copy Markdown
Member Author

Epochs browser decluttered a bit:

https://7071-1301584-gh.circle-artifacts.com/0/tmp/circle-artifacts.jYKTBYE/html/auto_tutorials/plot_whitened.html

Feel free to comment on the aesthetic as I plan to make both epochs and raw ylabels look like this version of the epochs browser

@agramfort

agramfort commented Feb 28, 2018 via email

Copy link
Copy Markdown
Member

@agramfort

Copy link
Copy Markdown
Member

@larsoner you'll have to rebase this one too :)

@larsoner larsoner added this to the 0.18 milestone Oct 4, 2018
@larsoner

larsoner commented Feb 8, 2019

Copy link
Copy Markdown
Member Author

This is a bit of a nightmare. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: group_by for epochs.plot()

2 participants