How to view a 3D Figure from "below", e.g. z-axis facing downwards
조회 수: 6 (최근 30일)
이전 댓글 표시
I'm looking for a possibility to view/rotate a North-East-Down Coordinate Frame in a 3D Figure.
By casually plotting a cartesian coordinate system z is facing upwards, and by rotating it with the hand tool, it is not possible to "flip" the figure so that z is facing down.
If you set the z-Axis to 'reverse' the right hand system becomes a left-hand system, thus this is not a solution.
figure
plot3(0,0,0)
line([0 0.1],[0 0],[0 0],'LineWidth',5,'DisplayName','X')
line([0 0],[0 0.1],[0 0],'LineWidth',5,'DisplayName','Y')
line([0 0],[0 0],[0 0.1],'LineWidth',5,'DisplayName','Z')
legend
Take the above picture, I would like a solution where the Z-Line is Facing downwards, without changing the coordinate-system
댓글 수: 0
채택된 답변
Matt J
2025년 1월 30일
편집: Matt J
2025년 1월 31일
Set the CameraUpVector axis property.
figure
plot3(0,0,0)
line([0 0.1],[0 0],[0 0],'LineWidth',5,'DisplayName','X')
line([0 0],[0 0.1],[0 0],'LineWidth',5,'DisplayName','Y')
line([0 0],[0 0],[0 0.1],'LineWidth',5,'DisplayName','Z')
set(gca, 'CameraUpvector',[0,0,-1])
legend
댓글 수: 3
Matt J
2025년 1월 31일
After some tinkering, I seem to have managed to lock the orientation of the UpVector with the following. I don't know why they make it so hard...
plot3(0,0,0)
ax=gca;
hListener = addlistener(ax, 'View', 'PostSet',@forceDown);
line([0 0.1],[0 0],[0 0],'LineWidth',5,'DisplayName','X')
line([0 0],[0 0.1],[0 0],'LineWidth',5,'DisplayName','Y')
line([0 0],[0 0],[0 0.1],'LineWidth',5,'DisplayName','Z')
camup(ax, [0,0,-1])
function forceDown(~,evt)
ax=evt.AffectedObject;
camup(ax,[0,0,-1])
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Plot Customization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!