More control over plot settings
See original GitHub issueDescribe the new feature or enhancement
Would it be possible to give users more control over (some of the) plotting parameters?
in my case, I wanted to plot multiple ERPs in a single figure. WIth plot_evoked, I could extract all the axes and gather all the plots in a single figure, however, the layout was not really nice (a lot of whitespace). I wished to constrain the layout, but couldn’t do so because in plot_evoked set_tight_layout is hardcoded to True, which is incompatible with a constrained layout.
Describe your proposed implementation
If I understand the structure correctly, there are front-end auxiliary plotting functions that users interact with and the actual plotting functions that are called in the background and do the plotting. As it seems, only a subset of the arguments that the plotting functions have are being used by those auxiliary functions. Would it be possible to pass those “hidden” arguments as kwargs? Like that the API would not be cluttered with secondary plotting parameters, but still allow for more flexibility?
Additional comments
As mentioned before, I only had a look at the plot_evoked function. I don’t know in how far something similar is also relevant for other plotting functions.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
you tried to do the right thing
set_tight_layout
should probably not be used systematically.
regarding kwargs I prefer to avoid them as much as possible as they are almost impossible to document and can lead to silent bugs
can you open a PR with the changes that are necessary to address your needs and looking at the diff we see how to move forward?
So far, I haven’t encountered much that I had trouble with, as I just started optimizing the visualization of my data. What might be relevant to you is:
axas inplot_raw_psd, sometimesaxesas inplot_evoked)plot_evoked). For example, even though I passed only two axes each on two separate calls to the function into the function, four axes got returned for each call. Other things were that adding titles/subtitles as well as x/y labels confused me e.g. labels disappeared). Eventually it looked like what I would have expected, but I don’t know what caused the issue in first place and how it was resolved (probably mistakes on my end)Here are also a few other plot-related things that came to my mind, in a wider sense of your question:
plot_raw). I would like to group the channels by more than one variable (i.e. location and type). I haven’t tried whether this could be done by combining thegroup_byand thepicksarguments, though.plot_image. I have seen power spectra plotted in that way (over frequencies and trials) and was impressed how nicely noisy trials can be identified. But yeah, given that this would be a 3d-plot it probably doesn’t fit your agenda.As I said, I haven’t spend a lot of time exploring all the ways to amend mne plots. It is quite likely that I have just missed obvious solutions. I will be spending quite a bit of time in the next weeks with plotting. I will report here (or in #7751) whenever I encounter something.