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

2 vues (au cours des 30 derniers jours)
Sophia
Sophia le 24 Mai 2016
Commenté : Sophia le 27 Mai 2016
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'.

Réponse acceptée

Kelly Kearney
Kelly Kearney le 25 Mai 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 commentaires
Kelly Kearney
Kelly Kearney le 26 Mai 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
Sophia
Sophia le 27 Mai 2016
Thanks.. It worked perfectly fine!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by