There will be 12 plots and I want to show 12 plots in one picture.

1 view (last 30 days)
James James
James James on 30 Nov 2021
Answered: Benjamin on 30 Nov 2021
clear all
Eqdate=datetime('18Jan23', 'Format', 'yyMMMdd', 'InputFormat', 'yyMMMdd');
files=dir('gps*');
for i=1:length(files)
disp(files(i).name);
[Date,East,North,Vertical] = readGPSfile(files(i).name);
%make a quick figure for each site
figure
plot(Date,North)
hold on
yax=ylim;
plot([Eqdate Eqdate],yax,'r') %magenta vertical line at time of earthquake
title(files(i).name)
X(i)=East(1);%set overall location of point to first E/N point (used in calc_okada)
Y(i)=North(1);
%the following approach does not work if you have an earthquake in the
%middle of a huge gap in your data! Then you will see the coseismic +
%interseismic deformation.
before = find(Date<Eqdate); %indices of points in time at least one day before the earthquake
after = find(Date>Eqdate); %indices of points in time at least one day after the earthquake
if(~or(isempty(before),isempty(after))) %only true if both before and after are defined
%find single day before and after
before = before(end);
after = after(1);
GPSdx(i)=East(after)-East(before);
GPSdy(i)=North(after)-North(before);
GPSdz(i)=Vertical(after)-Vertical(before);
else
GPSdx(i)=NaN;
GPSdy(i)=NaN;
GPSdz(i)=NaN;
end
end
figure
quiver(X,Y,GPSdx,GPSdy,'k')
title('EQ displacements-dx,dy')
There will be 12 plots and I want to show 12 plots in one picture.
Would you help me??

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by