[ENH] - Update options to plot a broader frequency range#276
[ENH] - Update options to plot a broader frequency range#276TomDonoghue merged 5 commits intomainfrom
Conversation
|
@TomDonoghue I think either approach could work. The one thing I'd change about the other PR is to store a reference to the original array, rather a copy of it, and then to log & plot the original reference based on an kwarg in .plot / .report. I like your approach here too, it's efficient and makes sense. This does add slight complications to the api for reporting and plotting. I can see an argument for leaving this up to the user to manage memory / create plots and not supporting the functionality. |
|
@ryanhammonds - yeh, I went back and forth a bit about the best way to do it and agree that I don't love complicating the API, and that the other approach should use a mask / selector rather than a copy (that idea also relates the fit range idea of #147). In the end, and after chatting with Voytek a bit, I think it is worth supporting this functionality, and we're going to go with this lighter weight version here, that allows for this without changing the data stored in the object. We can always revisit and extend the options for stuff like this in 2.0 or after. So, for now, I'm going to merge this in, instead of (and close) #246 |
Responds to #245, and an alternative to #246
This PR adds functionality for making it easier to plot a model over a broader frequency range (across a frequency range beyond the fit range). It does so by making it easier to pass in frequency and power vectors to plot with a model. This strategy means that the model object does not store the broader range, but during exploration phases this can be visualized.
Notes:
For reviewing, @ryanhammonds and @voytek (if you have time) - before a code deep-dive, I would appreciate your thoughts on strategy here (comparing this to #246). If we like this approach then code should be reviewed as normal - I think it should be pretty solid, although there could be some tweaks on how to manage the API for
FOOOF.reportif y'all have any thoughts on that.Demonstration
Code for running following examples:
Using
plot_fmto plot models on top of broader range power spectraWhich gives the following output:

Exploring frequency ranges using
fm.reportThis gives the following output:

In addition, these reports can be saved out.
Showing how this works with
FOOOFGroupThis process can also be used from a FOOOFGroup object, to examine individual model fits:
Output:
