automaticaly resize subplots when ylabels removed

Hi, I am plotting 6 plot in a subplot. To make the figures as big as I can I want to remove the yticklabel and ylabel on 4 of the subplots. To do so I used the following code:
% code
for i=1:6
subplot(2,3,i)
plot(x,y)
ylim([0 2500])
if i==1|i==4
ylabel('elevation (m)')
else
set(gca,'ylim',[0 2500],'ytick',[0:500:2500] ,'yticklabel',{})
end
end
In doing that, I do remove the labels in the targeted subplot but they are replaced by blank space. Is there a way to force matlab to use these blank spaces to make the graph bigger without having to set the position of the graphs by doing, for example :
set(h1,'units','centimeters','position',[1.5 9 6.3 7.8]);)
Thanks,
R2010a

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!