subplot with for loop after 10 new figure
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I plot subplots with a for loop. After 10 subplots I want a new figure with the next 10 subplots an so on. At the end there shold be a number of figures each 10 subplots.
Thanks in advance.
Here my code:
for i=1:10
sgtitle('WSPL zeitlicher Verlauf Modell D Teil 1')
subplot(10,1,i)
hold on
p1=plot (col2_Z(:,i) , [col3_Z(:,i), col3_HQextrem(:,i), col3_HQ5000(:,i), col3_HQ10000(:,i)]);
title(['Zeit [h] ', num2str(i)])
grid on
leg=legend(p1,{'Geländehöhe','HQextrem','HQ5000', 'HQ10000'})
title(leg,'WSPL')
newcolors = {'#000000','#7E2F8E','#0000FF','#00FFFF'};
colororder(newcolors)
end
0 个评论
采纳的回答
Chunru
2022-5-4
for i=1:100 % any number
if rem(i-1, 10) == 0
figure;
end
sgtitle('WSPL zeitlicher Verlauf Modell D Teil 1')
subplot(10, 1, rem(i-1, 10)+1);
hold on
p1=plot (col2_Z(:,i) , [col3_Z(:,i), col3_HQextrem(:,i), col3_HQ5000(:,i), col3_HQ10000(:,i)]);
title(['Zeit [h] ', num2str(i)])
grid on
leg=legend(p1,{'Geländehöhe','HQextrem','HQ5000', 'HQ10000'})
title(leg,'WSPL')
newcolors = {'#000000','#7E2F8E','#0000FF','#00FFFF'};
colororder(newcolors)
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!