looping figures with text labels
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello,
I am trying to repeat a set of text labels to figures that are being generated in a for loop
%M1 is a 49 x k1 matrix that contains the 49 y values that will be looped k1 times
%X1 is a 49 x 1 matrix that contains the 49 x values
% stcM1C is a 49 x 1 vector that contains the 49 strings that need to be printed in each figure
%%figure loop with labels
stcM1C=char(stc(:,1));
for k1=1:1:k1;
i1=M1(:,k1);
x1=X1(:,1);
figure(k1)
plot(x1,i1,'ok','MarkerFaceColor','g')
hold on
text(x1,i1,stcM1C,...
'fontsize',6,...
'verticalalignment','bottom');
end
Any assistance would be great.
thanks, Mark
댓글 수: 0
채택된 답변
Image Analyst
2013년 5월 14일
편집: Image Analyst
2013년 5월 14일
I don't know what stc1 is, but I think it should be inside the loop if you want it to change with every figure.
% Create a string inside the loop that depends on k1.
caption = sprintf('This is figure #%d', k1); % Or use, stc1.
% Add title above the axes.
title(caption, 'FontSize', 15);
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!