Import figure with subplots

Hi there,
simple question. I want to import a figure which is made of a number of subplots and does something with it. How to handle that? I mean, how to access each single subplot and modify something in a loop, for instance?
Cheers. C

 채택된 답변

Jan
Jan 2011년 3월 28일

1 개 추천

FigH = hgload(FigFileName);
% EDITED: 'flat' without leading '-'
AxesList = findobj(get(FigH, 'Children'), 'flat', 'Type', 'axes');
% If there are additional AXES objects in the figure,
% which are no SubPlot's use an additional property
% to exclude/include them in the FINDOBJ command.
for aAxes = reshape(AxesList, 1, [])
set(aAxes, 'Color', rand(1, 3));
end

추가 답변 (1개)

Chiara Modenese
Chiara Modenese 2011년 3월 28일

0 개 추천

Thank you. The option '-flat' worked without the minus for me. Cheers, C.

댓글 수: 3

Chiara Modenese
Chiara Modenese 2011년 3월 28일
If I can ask, how would you change the labels in each subplot? I tried to use both get() and set() but could not find the way to do it.
Thanks again, C
Jan
Jan 2011년 3월 28일
Which label do you mean? XTick labels, X-/Y-labels, titles, or do you have text labels inside the plots?
Chiara Modenese
Chiara Modenese 2011년 3월 28일
Sorry, I should have specified that. I meant the text labels inside the plots. Thanks, Chiara

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

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

질문:

2011년 3월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by