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.

infoinstance of Info

The measurement info.

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.


The figure face color. Defaults to black.


The axis face color. Defaults to black.


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.


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.


A generator that can be unpacked into:


The current axis of the topo plot.


The related channel index.

Examples using mne.viz.iter_topography