-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshiftRePlot.m
More file actions
31 lines (31 loc) · 938 Bytes
/
shiftRePlot.m
File metadata and controls
31 lines (31 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
dt = ShiftInfo.dt;
i1 = ShiftInfo.i1;
i2 = ShiftInfo.i2;
di = ShiftInfo.di;
j1 = max(1,i1-di);
j2 = min(i2-di,length(ShiftInfo.d));
if ShiftInfo.subMean
temp = ShiftInfo.d(1,i1:i2);
d1bar = mean(temp(~isnan(temp)));
temp = ShiftInfo.d(2,j1:j2);
d2bar = mean(temp(~isnan(temp)));
y1 = ShiftInfo.d(1,i1:i2)-d1bar;
y2 = ShiftInfo.d(2,j1:j2)-d2bar;
else
y1 = ShiftInfo.d(1,i1:i2);
y2 = ShiftInfo.d(2,j1:j2);
end
axes(ShiftInfo.hax);
hold off
plot([i1:i2],y1); hold on
plot([j1+di:j2+di],y2,'r');
set(gca,'Xlim',[i1,i2],'FontWeight','demi')
title('Positive shifts move red curve to the right')
legend(ShiftInfo.Names);
k = ShiftInfo.ShiftFile;
clr = [0 0 1; 1 0 0];
start = ShiftInfo.LoadedDataFiles{k}.start;
di = ShiftInfo.di;
startString=datestr(datenum(start)+dt*(di*(-1)^k)/(24*3600));
set(findobj('Tag','Corrected Start Time','Parent',hfig),...
'string',startString,'Foregroundcolor',clr(k,:));