When I choose a huge colorbar fontsize, why is the colorbar text cropped by the MATLAB figure window in MATLAB 7.3 (R2006b) ?

6 views (last 30 days)
When I choose a huge colorbar fontsize in MATLAB 7.3 (R2006b) like in the following example:
figure;
Y_tick = 12.34;
caxis([0.0 Y_tick]);
colorbar1 = colorbar(...
'EastOutside',...
'Box','on',...
'FontSize',30,...
'TickDir','out',...
'XLim',[-0.5 1.5],...
'YTick',[0 Y_tick]);
the text of the colorbar is not displayed completely in the figure window.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
To work around this issue resize the axes using GET and SET functions:
decrease_by = 0.1
axpos = get(gca,'position');
axpos(3) = axpos(3) - decrease_by;
set(gca,'position',axpos);
Alternatively, the decrease of axes in y-direction (defined in the above example by variable 'decrease_by') could be chosen dynamic - according to the needed additional space referring to the new font size of the colorbar.

More Answers (0)

Products


Release

R2007a

Community Treasure Hunt

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

Start Hunting!