How to change the angle of xticklabel?

조회 수: 5 (최근 30일)
Leon
Leon 2022년 2월 2일
편집: Voss 2022년 2월 2일
Matlab has been automatically slanting my xTickLabels even when the font size is not that big and can fit the x-axis just fine without angled.
Is there a way to force it to be angled at 0-degrees (i.e., not slanted)?
Many thanks!

채택된 답변

Voss
Voss 2022년 2월 2일
편집: Voss 2022년 2월 2일
You can use set(gca(),'XTickLabelRotation',0);
To demonstrate:
figure();
plot(1:10);
set(gca(),'XLim',[1 10],'XTick',1:0.5:10,'Fontsize',16); % automatically rotated
figure();
plot(1:10);
set(gca(),'XLim',[1 10],'XTick',1:0.5:10,'Fontsize',16,'XTickLabelRotation',0); % force to horizontal

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by