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?

 Réponse acceptée

José-Luis
José-Luis le 26 Déc 2012
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

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by