Plot three graphics aligned.

Hi!
I would like to plot three graphics. But I wanto two on the first line and one on the second line, in the center of the image. I tried to use subplot but it didn't worked (or I don't know how to use it right).
It is more or less like this:
AAA AAA
AAA
Can anyone help me with that?
Thanks very much for you time.

답변 (2개)

Star Strider
Star Strider 2014년 4월 30일
편집: Star Strider 2014년 4월 30일

1 개 추천

This may be what you want to do:
t = linspace(0,10*pi);
for k1 = 1:3
y(k1,:) = sin(t*k1);
end
subplot(2,2,1)
plot(t,y(1,:))
subplot(2,2,2)
plot(t,y(2,:))
subplot('Position',[.33 .1 .35 .35])
plot(t,y(3,:))
produces:
See the documentation for subplot under ‘More About’ and ‘Tips’.

댓글 수: 2

Or, if you want a layout exactly like you showed, you can switch from 2,2 to 2,3. Modify Star's code like this:
t = linspace(0,10*pi);
for k1 = 1:3
y(k1,:) = sin(t*k1);
end
subplot(2,2,1)
plot(t,y(1,:))
subplot(2,2,2)
plot(t,y(2,:))
subplot(2,3,5) % <--- Changed line.
plot(t,y(3,:))
You can do further tweaking of size and location by asking suplot to return the handle and setting the 'Position' property of the subplot with the set() function:
set(hPlot, 'Position', [left, top, width, height]);
Star Strider
Star Strider 2014년 4월 30일
Image Analyst — Interesting alternative. Thanks!

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

per isakson
per isakson 2014년 4월 30일

0 개 추천

Search the FEX for alternative to subplot

카테고리

제품

질문:

2014년 4월 30일

댓글:

2014년 4월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by