plotting on multi figures

조회 수: 4 (최근 30일)
Jason
Jason 2011년 5월 11일
I plot data to a figure using a function i have created(using code generation):
function createPlot(x1, y1, title)
figure1 = figure;
% Create axes
axes1 = axes('Parent',figure1,'YGrid','on','XGrid','on');
box(axes1,'on');
hold(axes1,'all');
% Create plot
plot(x1,y1,'LineWidth',2,'DisplayName','y1 vs. x1');
% Create textbox
annotation(figure1,'textbox',...
[0.170811320754717 0.777089783281734 0.237993710691824 0.111455108359134],...
'Interpreter','none',...
'String',{title},...
'FontSize',12,...
'FitBoxToText','off',...
'LineStyle','none',...
'Color',[1 0 0]);
I now write a script to run this for all files in a folder. How can i make each call of the createPlot function above to plot on a different figure

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 5월 11일
It should be opening a new figure each time you call it because of the 2nd line:
figure;
?
So just call it multiple times.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by