-
Notifications
You must be signed in to change notification settings - Fork 0
2.5.6 plotSEM()
Shun Li edited this page Jul 23, 2024
·
5 revisions
plotSEM()
takes in an array and plot the average and SEM by row. This is heavily used to plot average of event aligned traces of a given signal (e.g. photometry, camera, lick rates, etc).
Required inputs
-
x
: double, the vector that stores x value of individual time points. Calledtimestamp
inplotTraces()
-
y
: double, the array where each row is each individual events and column is timepoints. Calledtraces
inplotTraces()
-
color
: color of the trace to be plotted
Options
-
smooth
: double, default is 0; determines the time duration (in seconds) of a smoothing window. Ifsmooth=0
, then no smoothing is performed. -
smoothMethod
: string, default is'movmean'
; determines which smoothing method is used for smoothing. See Matlab methodsmoothdata()
for more options. -
plotMean
: logical, default is true. -
plotPatch
: logical, default is true; iffalse
, only the mean trace will be plotted and the shaded areas indicating SEM will not. -
plotIndividual
: logical, default is false; iftrue
, it will plot individual trace in the background -
individualColor
: default is 'gray'; this determines the color of individual trace. If entersame
, then the individual trace will follow the color of mean trace determined bycolor
, adding some alpha determined byindividualAlpha
. -
individualAlpha
: double, default is 0; determines the transparency of the individual traces.1
is fully transparent. -
LineStyle
: string, default is "-"; determines the line style of the mean trace. See Matlab documentation for details. -
LineWidth
: any numeric values, default is 2; determines the width of line. See Matlab documentation for details. -
plotStyle
: string, default is 'line'; determines the style of plot. It also can be set tostairs
, which will give a stairs plot. See Matlab documentation ofstairs()
method for details. -
delta
: double, default is empty ([]
); This specify the time window to calculate mean value and subtract it from the whole trace. Normally used for baseline subtraction.
- There is no outputs of this function. Do make sure to use
initializeFig()
before calling any plotting functions.
initializeFig(0.5,0.3);
combined = combineTraces(animals,timeRange=[-0.5,3],...
eventRange='Water',...
animalRange=["SL133","SL135"],...
taskRange='Random',...
totalTrialRange=totalTrialRange,...
trialRange=trialRange,...
signalRange='NAc');
plotSEM(combined.timestamp,combined.data{1},[.213 .543 .324]);
xlabel('Time (s)'); ylabel('z-score');