How do I shift the axes labeling in matlab?

By axis labeling, I mean the values (1,2,3,...10) written below the x-axis. I want to shift it down.Using the following code, I am able to shift the axis name down.
xlabh = get(gca,'xlabel');
set(xlabh,'Position',get(xlabh,'Position') - [0 0.005 0]);

답변 (2개)

Image Analyst
Image Analyst 2017년 6월 20일

1 개 추천

Do you perhaps mean
ax = gca; % Get handle to current axes.
ax.XAxisLocation = 'origin'; % Put ticks and labels next to x axis instead of outside the box.
Jan
Jan 2017년 6월 20일

0 개 추천

You cannot control the position of the tick labels. Does changing the tick length help? https://www.mathworks.com/help/matlab/ref/numericruler-properties.html#property_d0e696160
Perhaps you can change the tick format to '\n%g'?

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

질문:

2017년 6월 20일

답변:

2017년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by