How to make the subplots look larger and use the space judiciously.

1 view (last 30 days)
figure(1);
clf;
for i = 1 : 11;
subplot(4,6,i)
m_proj('Stereographic','lat',90,'long',300,'radius',35,'rect','on');
if i<=6;
m_contourf(long,lat,wint2_u(:,:,i),'linestyle','none');
else
m_contourf(long,lat,an_u(:,:,(i-6)),'linestyle','none');
end
m_grid('linewi',1,'tickdir','out',...
'xtick',6,'ytick',[72 78 84 90],...
'xticklabel',[]);
m_coast('patch',[.6 .6 .6],'edgecolor','k');
m_elev('contour',[ ],'edgecolor',' ');
caxis([-11 6])
axis tight
axis off
end
h4=colorbar;
set(h4, 'Position', [.785 .550 .01 0.15])
I like the following link and treid using it but did not work out. Any suggestions how can i use this in my script. http://stackoverflow.com/questions/6685092/how-to-reduce-the-borders-around-subplots-in-matlab
The error message is Undefined function 'subaxis' for input arguments of type 'double'.

Accepted Answer

Kelly Kearney
Kelly Kearney on 25 May 2016
To use the subaxis function, you need to follow the link provided there on the stackoverflow answer you reference (or this one: subaxis), download that code, and place it somewhere on your Matlab path.
  3 Comments
Kelly Kearney
Kelly Kearney on 26 May 2016
To add titles, save the handles to your axes
ax(i) = subaxis(3, 6, i, ...)
Then you can pass the handles to title
for ii = 1:length(ax)
title(ax(ii), sprintf('Thing %d', ii));
end

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!