-
Notifications
You must be signed in to change notification settings - Fork 65
/
plotusgs.m
61 lines (54 loc) · 1.2 KB
/
plotusgs.m
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
56
57
58
59
60
61
%
% PLOTUSGS
%
% Read receiever data in format specified by USGS for the Hayward
% fault earthquake scenarios and plot it in 3 subwindows
%
% plotusgs(filename, colorstring, erasefirst, timeshift)
%
% Input: filename - Name of receiever data file
% colorstring: string passed to plot, like 'r' for red lines
% erasefirst: 0 does a 'hold on' for the current plot, otherwise erases the current figure
% timeshift: change independent variable to be t+timeshift
%
function plotusgs( filename, colorstring, erase, tshift )
if nargin < 4
tshift = 0;
end;
if nargin < 3
erase = 1;
end;
if nargin < 2
colorstring='b';
end;
[t ux uy uz]=readusgs(filename);
if (erase ~= 0)
clf;
end
% east component
subplot(3,1,1)
if (erase == 0)
hold on;
end
h=plot(t+tshift,ux,colorstring);
%set(h,'LineWidth',2.0)
set(gca,'FontSize',20)
axis tight;
% north component
subplot(3,1,2)
if (erase == 0)
hold on;
end
h=plot(t+tshift,uy,colorstring);
%set(h,'LineWidth',2.0)
set(gca,'FontSize',20)
axis tight;
% up component
subplot(3,1,3)
if (erase == 0)
hold on;
end
h=plot(t+tshift,uz,colorstring);
%set(h,'LineWidth',2.0)
set(gca,'FontSize',20)
axis tight;