BUG: TFR.plot misc issues
See original GitHub issueI am experiencing several issues with the .plot
method of TFR objects. I suspect that there are several things off, but for now I found this obvious bug:
These are valid inputs for the title
parameter:
Yet in the code, we have this logic:
Hence, when I pass title='auto'
, my figure will have the title auto
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Plotting of mne.combine_evoked output based on ...
Here above I have the TFR output from 1 grad and 20 grad, which looks too similar to me. The two tfr_contrast objects...
Read more >What's new — MNE 1.2.2 documentation
PSD plots will now show non-data channels (e.g., misc ) if those channels are explicitly passed to picks , by Daniel McCloy. Fix...
Read more >Effect Displays for Linear, Generalized Linear, and Other Models
allEffects identifies all of the high-order terms in a model and returns a list of "eff" or "effpoly" objects (i.e., an object of...
Read more >ATOMS : Time Frequency Toolbox details - Scilab
This Toolbox was ported from http://tftb.nongnu.org It contains many algorithms implementing various kinds of time-frequency analysis with a special ...
Read more >iFly GPS™ Release Notes
Fixed bug with clearing altitudes for a flight plan with procedures but only a single altitude for the whole plan. Fixed issue with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh boy, this is really quite a challenge to unpack 😃
a couple of design question:
The
auto
value fortitle
, number of picks, andcombine
are co-dependenttitle='auto'
is supposed to concatenate channels names for up to 6 picks. This would only make sense when there are multiple picks and those picks are combined into a single figure (with thecombine
keyword). Otherwise, I don’t see why I would want to have all picks in the title of a figure that only shows one pick. In case multiple picks are combined, I am not sure whether listing the channels is the best representation. At least in viz/utils.py it seems to be to produce a title likeRMS/AVG of X electrodes
instead of just a list of channel names. Perhaps a combination of the two would be better? (e.g.AVG of Ch1, Ch2, ...
, for fewer than 6 picks).In any case, what
mne
promisesauto
will do, is only reasonable for a specific combination of parameters. What would be the best approach to deal with that? Explain it in the doc? Raising exceptions? Silently adjusting the output whenever it does not make sense (i.e. multiple picks, uncombined)?return separate figures or subplots?
Right now, the function promises to return multiple figures (even though it actually only returns a single figure). Is the idea to have a separate figure for each pick, or would it make sense to collect the tr plots in subplots of a figure and return that one? Or allow for both? If it should be possible to return multiple figures, they probably should be returned as a list of figures.
Tomorrow during the sprint, I’ll try to move further into this rabbit hole. Happy to chat then!
yes that function is unusable for anything other than plotting a single TFR. If you look at the code the
return
is inside the loop so it shouldn’t be surprising that it doesn’t work with multiple channels. https://github.com/mne-tools/mne-python/blob/056c273f1bb96bb3229e60874122f830f946746c/mne/time_frequency/tfr.py#L1280-L1284For what its worth it is relatively easy to write your own wrapper that will do what you need it to. I use something (https://gist.github.com/bloyl/a08a64899f2feffda5271890a5c6a677) based off the plotting in https://mne.tools/stable/auto_examples/time_frequency/plot_time_frequency_erds.html#sphx-glr-auto-examples-time-frequency-plot-time-frequency-erds-py to plot multi channel tfrs.