-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotSetup.m
More file actions
55 lines (52 loc) · 1.65 KB
/
plotSetup.m
File metadata and controls
55 lines (52 loc) · 1.65 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function [plotStart] = plotSetUp(tUnits,nTunits,dt)
% Usage: [plotStart] = plotSetUp(tUnits,nTunits,dt);
% Initializes data structure plotStart, which contains
% parameters used to initialize time series plotting
% window. All input arguments are optional.
% Edit the file to change defaults ... or to add new
% optional inputs
% tUnits gives units for labeling the x-axis on the time
% series plot. Options are 'Seconds', 'Minutes', 'Hours', 'Days'
% nTunits is number of tUnits of data to plot in one window
% default is 6 'Hours'
% dt is assumed sampling interval for plotted time series
% default is 1 ... only used (with tUnits, nTunits)
% to calculate number of points to plot; should recompute
% this number after reading data file (so that true sampling
% interval is known) anyway!
if(nargin < 3)
dt = 1;
end
if(nargin < 2)
nTunits = 6;
end
if(nargin == 0)
tUnits = 'Hours';
end
UNITS = {'Seconds','Minutes', 'Hours', 'Days'};
TFACS = [1,60,3600,86400];
for k = 1:length(UNITS)
if(strcmp(UNITS{k},tUnits))
break
end
end
tFac = TFACS(k);
% nPw is computed here assuming a sampling interval in the input
% file (before post-reading decimation) of dt = 1 ... this should
% always be set after reading the data file, and before intializing
% the plot
nPw = fix(nTunits*tFac/dt);
i0 = 1;
di = 1;
SCALE = 1;
centered = 1;
rangeScale = .5;
page = 1;
t0Eq0 = 1;
yFac = 1;
T12 = [];
rect0 = [5,35,1015,515];
plotStart = struct('i0',i0,'di',di,'nPw',nPw,'centered',centered,...
'page',page,'t0Eq0',t0Eq0,'tUnits',tUnits,'nTunits',nTunits,...
'tFac',tFac,'rangeScale',rangeScale,'yFac',yFac,'T12',T12,...
'rect',rect0);