mne.viz.iter_topography

mne.viz.iter_topography(info, layout=None, on_pick=None, fig=None, fig_facecolor='k', axis_facecolor='k', axis_spinecolor='k', layout_scale=None, legend=False)[source]

Create iterator over channel positions.

This function returns a generator that unpacks into a series of matplotlib axis objects and data / channel indices, both corresponding to the sensor positions of the related layout passed or inferred from the channel info. Hence, this enables convenient topography plot customization.

Parameters
infomne.Info

The mne.Info object with information about the sensors and methods of measurement.

layoutinstance of mne.channels.Layout | None

The layout to use. If None, layout will be guessed.

on_pickcallable() | None

The callback function to be invoked on clicking one of the axes. Is supposed to instantiate the following API: function(axis, channel_index).

figmatplotlib.figure.Figure | None

The figure object to be considered. If None, a new figure will be created.

fig_facecolorcolor

The figure face color. Defaults to black.

axis_facecolorcolor

The axis face color. Defaults to black.

axis_spinecolorcolor

The axis spine color. Defaults to black. In other words, the color of the axis’ edge lines.

layout_scalefloat | None

Scaling factor for adjusting the relative size of the layout on the canvas. If None, nothing will be scaled.

legendbool

If True, an additional axis is created in the bottom right corner that can be used to, e.g., construct a legend. The index of this axis will be -1.

Returns
gengenerator

A generator that can be unpacked into:

axmatplotlib.axis.Axis

The current axis of the topo plot.

ch_dxint

The related channel index.

Examples using mne.viz.iter_topography