How to view a 3D Figure from "below", e.g. z-axis facing downwards
10 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Matt J
on 30 Jan 2025
Edited: Matt J
on 31 Jan 2025
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 Comments
Matt J
on 31 Jan 2025
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
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
