Closed drammock closed 2 years ago
plot_field is already used for visualizing the field projected onto a 3D surface (scalp/helmet)
... and is something I only discovered a few months ago.
If we'd had something like plot_topomap(..., mode: Literal["2d", "3d"] = "2d")
, it would have been much easier to discover. That said, I'd actually appreciate merging the functionality of both functions into plot_field()
If this doesn't work because the list of parameters would explode, I'd like to see plot_field_2d()
/ plot_field_3d()
instead (or plot_topomap_2d()
/ plot_topomap_3d()
)
I think standardizing the API for the different topoplots is a very good idea! I like plot_topography()
, a slightly shorter variant would be plot_topo()
. Deprecating the existing methods is a good and tried approach, I like it. I would include a "2d"
/"3d"
parameter rather than have two separate functions.
Most people use plain defaults for plotting. I would not come up with a new method name. It’s been there for too long and there are too many code relying on this. I would rather deprecate the parameters (eg if we go for units then add units and raise deprecation warning with unit parameter).
In working on the API / implementation of
.plot_topomap()
for the new Spectrum class, I went to our existing API for inspiration. Turns out it's rather fragmented. Here's a table of the signatures for:...along with notes about what each parameter does.
times
r+
As you can see, there are many inconsistencies, some of them rather egregious (e.g., 'unit' vs 'units' for the same functionality). Some inconsistency is to be expected since some of these methods are doing different things (e.g.,
Evoked.plot_topomap()
just plots the average signal value and does not offer any frequency-specific / power plotting).I would like to take this opportunity to standardize the
plot_topomap
APIs to the extent possible. I know we're often a bit lax about backward compatibility when it comes to plotting functions, but bringing these all into some semblance of alignment will be a pretty big API change I think. One possible approach to consider is coming up with a new name and letting the old method names hang around for a couple of releases (with deprecation warnings). Possibilities:plot_field
is already used for visualizing the field projected onto a 3D surface (scalp/helmet)plot_topography
is the most neutral choice I can think of, but also vagueplot_scalp_topography
is long but is evocative of the head diagram, so maybe good?Would love to hear others' thoughts on this.