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

조회 수: 5 (최근 30일)
Chris
Chris 2021년 11월 30일
답변: Voss 2021년 11월 30일
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??

답변 (1개)

Voss
Voss 2021년 11월 30일
Maybe subplot will work.

카테고리

Help CenterFile Exchange에서 Earthquake Engineering에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by