-
Notifications
You must be signed in to change notification settings - Fork 2
2.5.5 plotEvent()
Shun Li edited this page Dec 6, 2023
·
3 revisions
Required inputs
-
label: string, the name of the event that is aligned to. If you don't wish to add any text next to the vertical line, input''instead. -
durationdouble, the duration of the event in seconds. It will display as shaded areas with lighter color (determined byFaceAlphadescribed below) comparing to thecolordefined below. If the event is short and meaningless to plot the shaded areas, input0instead.
Options
-
color: default is 'r'; can input any format of color that Matlab accepts. -
x: double, default is 0; determines where on the x axis the vertical line is plotted at. Since by default traces are aligned at 0, the default is also 0 -
unit: string, default is 's'; determines the unit ofduration. Can also bems. -
FaceAlpha: double, default is 0.1; determines the color difference between the vertical line and following shaded areas. -
LineWidth: double, default is 1.5; determines the width of the vertical line. See Matlab documentation for more information. -
LineStyle: string, default is'-'; determines the style of the vertical line. See Matlab documentation for more information.
- There is not explicit outputs of this function, it will plot a vertical line in the existing figure instance (ie
gcf)
- If the event have no duration
initializeFig(0.5,0.3);
[traces,t] = plotTraces(waterIdx,timeRange,signal,bluePurpleRed(1,:),params,...
signalFs=50,signalSystem='LJ');
plotEvent(Water,0,color=bluePurpleRed(1,:));
xlabel('Time (s)'); ylabel('z-score');

- If the event have some certain duration
initializeFig(0.5,0.3);
combined = combineTraces(animals,timeRange=[-0.5,3],...
eventRange='Stim',...
animalRange=["SL133","SL135"],...
taskRange='Random',...
totalTrialRange=totalTrialRange,...
trialRange=trialRange,...
signalRange='NAc');
plotSEM(combined.timestamp,combined.data{1},bluePurpleRed(end,:));
plotEvent('Stim',500,color=bluePurpleRed(end,:),unit='ms')
xlabel('Time (s)'); ylabel('z-score');
