Label Rotation in MATLAB 2014

조회 수: 8 (최근 30일)
Matlab2010
Matlab2010 2014년 9월 15일
답변: Mina Kheirkhah 2019년 1월 29일
Has MATLAB 2014a introduced a built in way of rotating axis labels? see here.
plot(1:3);
set(gca, 'XTICK', 1:3);
set(gca, 'XTICKLABEL', {'aaa', 'bbb', 'ccc'});
set(gca, 'Rotation', 45);
However this gives:
Error using hg.axes/set
The name 'Rotation' is not an accessible property for an instance of class 'axes'.
Have I misunderstood?
  댓글 수: 2
Carl Witthoft
Carl Witthoft 2015년 5월 20일
This works: set(get(gca,'YLabel'),'Rotation',-25);
Javier
Javier 2017년 2월 15일
Just works for labels, not for Ticks.

댓글을 달려면 로그인하십시오.

답변 (2개)

Sean de Wolski
Sean de Wolski 2014년 9월 15일
In R2014a, you need to replace the tick labels with text which can be rotated. here are a few utilities to help:
  댓글 수: 3
Sean de Wolski
Sean de Wolski 2014년 9월 15일
The above is R2014a.
R2014b has not shipped and the R2014b prerelease's features are confidential under NDA.
Steven Lord
Steven Lord 2017년 2월 15일
Now that release R2014b has shipped, I can confirm that tick label rotation was added in that release. See the "Other enhancements and new customization options" paragraph in the "New Visual Look" section of this documentation page.

댓글을 달려면 로그인하십시오.


Mina Kheirkhah
Mina Kheirkhah 2019년 1월 29일
Just use: xtickangle(45)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by