Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

8.10.24. nilearn.plotting.plot_event

nilearn.plotting.plot_event(model_event, cmap=None, output_file=None, **fig_kwargs)[source]

Creates plot for event visualization.

Parameters
model_eventpandas DataFrame or list of pandas DataFrame

The pandas.DataFrame must have three columns event_type with event name, onset and duration. The pandas.DataFrame can also be obtained from nilearn.glm.first_level.first_level_from_bids.

cmapstr or matplotlib.cmap, optional

The colormap used to label different events.

output_filestring or None, optional

The name of an image file to export the plot to. Valid extensions are .png, .pdf, .svg. If output_file is not None, the plot is saved to a file, and the display is closed.

**fig_kwargsextra keyword arguments, optional

Extra arguments passed to matplotlib.pyplot.subplots.

Returns
Plot Figure object

8.10.24.1. Examples using nilearn.plotting.plot_event