필터 지우기
필터 지우기

hello, i have 4 figures and need to combine them to one. How can I do it?

조회 수: 4 (최근 30일)
neha
neha 2013년 3월 28일
Any help would be appreciated...Thank you
  댓글 수: 1
Jan
Jan 2013년 3월 28일
What do you want to combine and what does "combine" exactly mean? Do you want to create a dock-figure, which contain the 4 figures with there borders and menus? Or do you want 4 subplot objects copied from the figures?

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

답변 (3개)

Sean de Wolski
Sean de Wolski 2013년 3월 28일
Figures cannot be containers for other figures. The typical approach to this is to create a uipanel and place what would typically be a figure's contents into it.

Mahdi
Mahdi 2013년 3월 28일
If you mean to plot 4 data sets onto the same figure, use the hold on after every plot (or you can do it all together):
x1=rand(1,20);
y1=rand(1,20);
x2=rand(1,20);
y2=rand(1,20);
plot(x1,y1,'ro',x2,y2,'b.')
This puts all of the data into the same figure. (the 'ro' and 'b.' are just formats) Alternatively, you can also do this
plot(x1,y1,'ro')
hold on
plot(x2,y2,'b.')

Jan
Jan 2013년 3월 28일
Perhaps you want something like this:
desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
myGroup = desktop.addGroup('myGroup');
desktop.setGroupDocked('myGroup', 0);
myDim = java.awt.Dimension(5, 2);
desktop.setDocumentArrangement('myGroup', 2, myDim)
figH = zeros(1, 10);
for iFig = 1:10
figH(iFig) = figure('WindowStyle', 'docked', ...
'Name', sprintf('Figure %d', iFig), 'NumberTitle', 'off');
set(get(handle(figH(iFig)), 'javaframe'), 'GroupName', 'myGroup');
end
This is heavily undocumented and tested in R2009a only.

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by