Plot data (group)
This function plots TMS-evoked activity averaged over participants. Timing of the TMS pulse is indicated with a red dashed line. Confidence intervals across participants can also be plotted.
To use this function, all of the participant files must be in the same folder and all files must have undergone identical tesa_peakanalysis runs or have the same electrodes. No other files should be in this folder. Open one file from the folder and run the function on this file and all files in the folder will be averaged and plotted.
Example group plot for a region of interest analysis with confidence intervals. Data are averaged across three individuals.

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.

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.
[ ]


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