Specifying properties of a subplot

조회 수: 3 (최근 30일)
Shannon
Shannon 2014년 2월 1일
댓글: Shannon 2014년 2월 2일
Hello,
I am trying to create a pdf figure in landscape view using Matlab. The figure is a 2X2 subplot that includes four different time series (I'm calling them North_cold, North_warm, South_cold, and South_warm). The time series need to be the same size and they need to be aligned with one another. Ideally, each subplot would be 2.5 inches tall and 4 inches wide, with a 1/4 inch space between them. Each time series will also have a title. I will have to align the figure in the middle of the page when it prints.
Any suggestions for how I can accomplish this would be greatly appreciated.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 1일
t=0:.1:10;
y=sin(t);
figure(1)
sp_v=1; % vertical space
sp_h=0.25; % horizontal space
w=4; % width
h=2.5; % height
marg=1; % margines
set(gcf,'units','inches','position',[0.5,0.5,w*2+sp_h+2*marg,h*2+sp_v+2*marg])
v=[marg marg+h+sp_v w h;w+marg+sp_h marg+h+sp_v w h;marg marg w h;w+marg+sp_h marg w h]
for k=1:4
subplot(2,2,k),
plot(t,y)
title(sprintf('title%d',k));
xlabel('x')
ylabel('y')
set(gca,'units','inches')
set(gca,'position',v(k,:))
end
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 2일
I don't know
Shannon
Shannon 2014년 2월 2일
Okay, thank you anyways :)

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by