Specifying properties of a subplot

1 回表示 (過去 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 Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by