several plot - subplot for-loop

조회 수: 4 (최근 30일)
GIOVANNA GUADAGNIN
GIOVANNA GUADAGNIN 2021년 5월 10일
댓글: GIOVANNA GUADAGNIN 2021년 5월 10일
I have several plot in a for loop.
I want to see them on one side but I can't figure out what values ​​I have to put in subplot () in a for loop
Files=dir('*.csv')
for k=1:length(Files)
filename=Files(k).name
filename='dataset_001.csv'
figure
yyaxis left
plot(p,ODsatpercent,'bo--');
yyaxis right
plot(p,Tclean.CTDTMP,'ro--');
legend('%Od','t');
end

답변 (2개)

Jan
Jan 2021년 5월 10일
Maybe:
...
subplot(1, length(Files), k);
yyaxis left
plot(p,ODsatpercent,'bo--');
yyaxis right
plot(p,Tclean.CTDTMP,'ro--');
legend('%Od','t');
  댓글 수: 2
Jan
Jan 2021년 5월 10일
After your comment: Then:
subplot(12, 13, k);
GIOVANNA GUADAGNIN
GIOVANNA GUADAGNIN 2021년 5월 10일
thank you!

댓글을 달려면 로그인하십시오.


GIOVANNA GUADAGNIN
GIOVANNA GUADAGNIN 2021년 5월 10일
thanks but this 'for' is for 122 different csvs which lead to a graph. I would like to make a matrix with size rows and columns = the square root of 122 to see all the graphs together

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by