필터 지우기
필터 지우기

tiled plots on two loops without overriding the succesive figures

조회 수: 1 (최근 30일)
juan sanchez
juan sanchez 2021년 11월 29일
편집: Cris LaPierre 2021년 12월 28일
I have arranged the tiled plots in the following way inside two loops so that the figures from the first loop don't over write the figures of the second loop. Is there any better way to do this? This code appears to work but I will like your opinion if there is a better way of doing this.
Is the tiledlayout and nexttile application properly applied here?
NP = 16; % 16 probes per page
[NRow, N_probe] = size(V_possible);
for k_page = 1: ceil(N_probe/NP)
screensize = get( groot, 'Screensize' );
figure('Position', screensize)
tiledlayout('flow','TileSpacing', 'Compact', 'Padding', 'Compact');
if k_page == ceil(N_probe/NP)
nplot = N_probe-NP*(k_page-1);% plots per page, last page could be less than 20
else
nplot = NP;
end
for kk= 1:nplot
nexttile(kk)
i_probe = NP*(k_page-1)+kk;
loglog(nraw1,sraw1,'-.b','LineWidth',1);
hold on
loglog(nraw2,sraw2,'-.r','LineWidth',1);
hold on
end %for kk
end %for k_page
for k_page = 1: ceil(N_probe/NP)
screensize = get( groot, 'Screensize' );
figure('Position', screensize)
tiledlayout('flow','TileSpacing', 'Compact', 'Padding', 'Compact');
if k_page == ceil(N_probe/NP)
nplot = N_probe-NP*(k_page-1);% plots per page, last page could be less than 20
else
nplot = NP;
end
for kk= 1:nplot
nexttile(kk)
i_probe = NP*(k_page-1)+kk;
loglog(nraw3,sraw3,'-.b','LineWidth',1);
hold on
loglog(nraw4,sraw4,'-.r','LineWidth',1);
hold on
end %for kk
end %for k_page

답변 (0개)

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by