How to auto rotate x/y/z-label to the same angle as the axis?

조회 수: 5 (최근 30일)
Micke Malmström
Micke Malmström 2017년 11월 27일
댓글: Micke Malmström 2017년 11월 27일
I use the 'Rotation' option to get the text aligned with the axis at the momet, eg:
xlabel('Frequency (MHz)','Rotation',-10)
but it is a bit time consuming, especially when you rotate the figure back anf forth to get a nice wiev.
Surely there must be a way to automatically rotate the labels so that they align with the direction of the actual axis? Maybe not actively when rotating but atleast with a command when using "surfc" for example...
  댓글 수: 2
Jan
Jan 2017년 11월 27일
What exactly is time consuming? Why "surfc"? How do you determine the value of the angle, -10 in your example?
Micke Malmström
Micke Malmström 2017년 11월 27일
trial and error is the method of determining -10 surfc is just an example...

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

답변 (1개)

Rik
Rik 2017년 11월 27일
You can get a handle to the 3d rotation, so if you determine the appropriate rotation (e.g. with the output of view), you can set the ActionPostCallback function.
h=rotate3d;
set(h,'ActionPostCallback',@myfunction);

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by