필터 지우기
필터 지우기

Rotating an entire axes in Matlab Guide

조회 수: 95 (최근 30일)
Kribashnee Dorasamy
Kribashnee Dorasamy 2017년 2월 26일
댓글: Jan 2017년 2월 27일
I am currently trying to rotate an entire axes named axes1.
imr=imrotate(img,30);
axes(this.gui_h.axes1);
imshow(imr,'Parent',this.gui_h.axes1);
The code above initiates a rotation of 30 degrees. However, the image is rotated but not the entire axes1. I have tested guide tools such as the rotate3D, however rotate3D does not work successfully for 2d images. I have also tried
set(handles.axes1,'Rotation',-25); ,
which has no effect. It simply overlooks the statement and continues with the other tasks. Is there a way to rotate the entire axes?

답변 (2개)

Jan
Jan 2017년 2월 26일
편집: Jan 2017년 2월 26일
image(rand(100, 100, 3));
view(30, 90);
This rotates the "view", the camera the user "is looking through". Alternative:
AxesH = gca;
UpVector = [-sind(30), cosd(30), 0];
DAR = get(AxesH, 'DataAspectRatio');
set(AxesH, 'CameraUpVector', DAR .* UpVector);
For set(gca, 'Rotation', -25) I get an error message:
Error using matlab.graphics.axis.Axes/set
There is no Rotation property on the Axes class.
  댓글 수: 2
Kribashnee Dorasamy
Kribashnee Dorasamy 2017년 2월 27일
Thank you.
I currently using
xlabel(handles.axes1,'X axis')
ylabel(handles.axes1,'Y axis')
camzoom(handles.axes1,1)
% Rotate the axes changing the Azimuth value
view(handles.axes1,[30 90]);
I noticed that the labels rotate perfectly. However, the image disappears. Can anyone tell why? Am I missing a step?

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


Stephen23
Stephen23 2017년 2월 27일
The easiest way to rotate the axes is to use the inbuilt function camorbit.

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by