Plot data
This function plots TMS-evoked activity averaged over trials. Timing of the TMS pulse is indicated with a red dashed line. Output from peak analyses can also be plotted, as well as confidence intervals across trials.
Example butterfly plot generated by tesa_plot. Data from one individual plotted using default settings. Red line indicates timing of TMS pulse.

EEGLAB user interface

1. Select the data to plot. All will plot a butterfly plot with all electrodes. Individual electrodes can be selected, as well as ROI and GMFA analyses.
2. Define the time limits for the x axis (in ms).
3. Define the amplitude limits for the y axis (in uV). Leave blank for auto-scaling.
4. Turn on/off 95% confidence intervals calculated across trials. This is only available for single electrode and ROI plots.
5. Turn on/off the peak analysis results for ROI and GMFA analyses. The + marks the peak and the dotted box indicates the time window. Peaks that were found are green and peaks not present are red. Note that tesa_peakanalysis needs to be run before this option is possible.


Base function

tesa_plot( EEG ); Default use.
tesa_plot( EEG, 'key1',value1... ); Custom inputs.

Pop function

pop_tesa_plot( EEG ); Pop up window.
'''pop_tesa_plot( EEG, 'key1',value1... );''' Custom inputs.

Required inputs

EEGLAB EEG structure

Optional inputs (key/value pairs)

Input value
Integers describing the x axis limits in ms.
Integers describing the y axis limits in ms. If left blank, the plot will automatically scale.
[ ]
String describing a single electrode for plotting. If left blank, a butterfly plot of all electrodes will be plotted.
[ ]
'on' or 'off'
Plot confidence interval calculated across trials. This option is not available for GMFA and butterfly plots.
Options for plotting output from tesa_tepextract and tesa_peakanalysis
'data' or 'ROI' or 'GMFA'
'data' input extracts data for plotting from 'ROI' input selects a ROI generated by tesa_tepextract. 'GMFA' input selects a GMFA generated by tesa_tepextract. Note that if multiple ROIs or GMFAs are present, 'tepName' must also be included to determine which one to plot.
String is either the name of a ROI or GMFA generated by tesa_tepextract. The default names generated by tesa_tepextract are 'R1','R2'... etc. however the user can also define names. This is required if multiple ROIs or GMFAs are present.
[ ]
'on' or 'off'
If 'on', peaks identified with tesa_peakanalysis will also be plotted. A box defining the lower and upper time limits in which the peak was searched will also be plotted. Green indiciates that a peak was found, red a peak was not detected. Note that tesa_peakanalysis must be run prior to using this function and 'tepType' must also be called.


pop_tesa_plot(EEG, 'xlim', [-200,600], 'ylim', [-10,10], 'elec', 'P1', 'CI', 'on'); Plot the average of electrodes P1 and P3, rescale the axes and include confidence intervals.
pop_tesa_plot(EEG, 'tepType', 'ROI', 'tepName', 'parietal', 'plotPeak', 'on', 'CI', 'on'); Plot the output from a ROI analysis called parietal including detected peaks and confidence intervals.
pop_tesa_plot(EEG, 'tepType', 'GMFA', 'plotPeak', 'on'); Plot output from a GMFA analysis including detected peaks
Last modified 1yr ago