I have this script that will generate 21 plots. I want to publish my script into a html file. I also would like to have these plots be organized into 3 columns and 7 rows. My script generates the plots in order left to right. Anyone know if this is possible with MATLAB?
Thanks

댓글 수: 8

Cedric
Cedric 2014년 7월 1일
편집: Cedric 2014년 7월 1일
I never published results using MATLAB embedded features, so we'll see what others can propose. If there is no answer by tomorrow though, it is certainly easy enough to build a small MATLAB script for generating HTML pages with your figures.
Cedric
Cedric 2014년 7월 1일
Also, as mentioned by Chad, do you need separate images or could you go for a single one with the whole array of images?
Hail
Hail 2014년 7월 1일
Each of my plots have a title and axis labels. Can I still get the title and axis labels if I do the subplot method. If so, how do you do the subplot method?
Yes,
doc suplot
and then experiment a little, you'll see that you can define labels/titles specific to each subplot.
figure('position',[100 100 800 2000])
subplot(7,3,1)
plot(x1,y1)
title('subplot 1 title')
xlabel('subplot 1 x label')
ylabel('subplot 1 y label')
subplot(7,3,2)
plot(x2,y2)
title('subplot 2 title')
xlabel('subplot 2 x label')
ylabel('subplot 2 y label')
...and so on...
subplot(7,3,21)
plot(x21,y21)
title('subplot 21 title')
xlabel('subplot 21 x label')
ylabel('subplot 21 y label')
I added the 'position' option to the figure because you'll probably want it to be wide and long. Adjust the width and height by changing 800 and 2000 to whatever value is best (in pixels).
Hail
Hail 2014년 7월 1일
Thank you. I forgot to mention that my plots are generated in a for loop. Will this still work?
Cedric
Cedric 2014년 7월 1일
편집: Cedric 2014년 7월 1일
Yes, the subplot ID should be your loop index, e.g.
for k = 1 : 21
subplot( 7, 3, k ) ;
x = ... ;
y = ... ;
plot( .. ) ;
grid on ;
xlabel( ... ) ;
ylabel( ... ) ;
title( ... ) ;
end
Hail
Hail 2014년 7월 1일
Fantastic. Thanks

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

 채택된 답변

Chad Greene
Chad Greene 2014년 7월 1일

0 개 추천

A quick and dirty solution would plot a single figure with 21 subplots.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2014년 7월 1일

댓글:

2014년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by