mne.viz.add_background_image

mne.viz.add_background_image(fig, im, set_ratios=None)

Add a background image to a plot.

Adds the image specified in im to the figure fig. This is generally meant to be done with topo plots, though it could work for any plot.

Note: This modifies the figure and/or axes in place.

Parameters:

fig: plt.figure :

The figure you wish to add a bg image to.

im: ndarray :

A numpy array that works with a call to plt.imshow(im). This will be plotted as the background of the figure.

set_ratios: None | str :

Set the aspect ratio of any axes in fig to the value in set_ratios. Defaults to None, which does nothing to axes.

Returns:

ax_im: instance of the create matplotlib axis object :

corresponding to the image you added.

Notes

New in version 0.9.0.