Is there a way to lower the XTickLabels a little?

My XTickLabels and YTickLabels slightly overlap for the two values at the plot origin (bottom left). I could simply use a smaller font but would prefer the following... Is there a way to lower the XTickLabels a little?

 採用された回答

José-Luis
José-Luis 2012 年 12 月 26 日

0 投票

aH = axes;
plot(rand(10,1));
xCoord = get(aH,'Xtick');
yCoord = get(aH,'YLim');
yCoord(2) = [];
offset = 0.05; %How far from the axes, in axes units
yCoord = yCoord-offset;
set(aH,'XTickLabel',[]); %Comment out this line to see where the old ticks were
for ii = xCoord
text(ii,yCoord,num2str(ii),...
'HorizontalAlignment','center',...
'VerticalAlignment','middle');
end

1 件のコメント

Justin Bailey
Justin Bailey 2012 年 12 月 26 日
Nice! Thank you so much... worked perfectly.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by