how to increase the height of sublpot?

Hello everyone,
Hope all of you are doing fine. Does any of my friend have any idea how to increase the height of subplot? I am using the following code to make eight subplots in four rows and two columns to see some variation in my data. But the final plot of all the subplots are not sufficiently high enough to see the variation. Can anybody tell me how can I increase the height of all the subplot in the following code:
for i = 13:30
dailydata = (timevec(:,3) == i);
figure
x1 = timevec( dailydata == 1,4 ) + timevec( dailydata == 1,5 )./60 ;
subplot(4,2,1);
plot(x1,denuder(dailydata == 1),'bo-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('Denuder (C)','FontSize',10);
title(datestr(timevec( find(dailydata == 1,1) ,:), 'yyyy-mm-dd'));
subplot(4,2,2);
plot(x1,htd_Line(dailydata == 1),'go-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('Htd line (C)','FontSize',10);
title(datestr(timevec( find(dailydata == 1,1) ,:), 'yyyy-mm-dd'));
subplot(4,2,3);
plot(x1,impactor(dailydata == 1),'mo-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('Impactor (C)','FontSize',10);
subplot(4,2,4);
plot(x1,case_1130(dailydata == 1),'ro-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('1130 case (C)','FontSize',10);
subplot(4,2,5);
plot(x1,pump(dailydata == 1),'ko-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('Pump (L)','FontSize',10);
subplot(4,2,6);
plot(x1,RPF(dailydata == 1),'co-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('RPF (C)','FontSize',10);
subplot(4,2,7);
plot(x1,pyro(dailydata == 1),'yo-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('Pyro (C)','FontSize',10);
xlabel('Time (hours)','FontSize',12);
subplot(4,2,8);
xxx = plot(x1,case_1135(dailydata == 1),'mo-','MarkerSize',2);
set(gca,'xlim',[0 24],'xtick',[0:2:24],...
'xticklabel',[0:2:24])
ylabel('1135 case (C)','FontSize',10);
xlabel('Time (hours)','FontSize',12);
saveas(xxx, strcat('SS file_daily plot\',datestr(timevec(find(dailydata == 1,1),:), 'yyyy-mm-dd')),'pdf');
end
Thank you very much in advance.

Answers (1)

Matt Fig
Matt Fig on 7 Sep 2012
Did you try two rows and four columns? This might be better if your monitor is wider than tall, like mine. Other than that, just save the handle to each subplot then use SET to increase their size via the position property.

4 Comments

Thanks for the suggestions. In fact, I tried two rows and four columns but there is a problem and that is I used 24 hours with 2 hours interval as the x-axis title which is squeezed. But I dont know how to implement the second option.
h = subplot(2,3,4);
plot(rand(10,1));
myPos = get(h,'Position');
%higher
myPos(4) = 2*myPos(4);
set(h,'Position',myPos);
You will need to adjust so your plots don't overlap.
Position vector = position of your axes -> [lower_left_x lower_left_y width height]
Thanks Jose. But I still have problem. When the number position is more than 4 I get the following error:
??? Attempted to access myPos(5);
index out of bounds because numel(myPos)=4.
But I need to apply for an array of (8,2, 1:16) to double the size of the subplot. Would you please tell how can I do that?
Thanks again.
Ohhh, I got the point. myPos(4) is fixed for all the subplots but now subplots are overlapping. How can I manipulate the value for position vector ? I mean what is the default value and how can change in order to avoid the overlapping of plots?
Thanks

Sign in to comment.

Asked:

on 7 Sep 2012

Community Treasure Hunt

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

Start Hunting!