Is there any option like zline?
82 views (last 30 days)
Show older comments
Nitin Phadkule on 23 Jul 2021
Commented: Chunru on 3 Aug 2021
I have drawn a 3D plot in app.UIAxes and added x and y axis by xline and y line, but not able to add zaxis line. why I am doing this because in 3D plots, axis is not located at origin. Is there any option like zline?
Chunru on 23 Jul 2021
If all you want is to plot x-y-z axis passing through origin, then you can do the following. (assuming that origin is somewhere inside the plot; otherwise set the xlim, ylim, zlim first).
y = (-1:.1:2);
z = peaks(x, y');
xlabel('x'); ylabel('y'); zlabel('z');
h = gca;
plot3(h.XLim, [0 0], [0 0], 'r')
plot3([0, 0], h.YLim, [0 0], 'r');
plot3([0, 0], [0 0], h.ZLim, 'r');
More Answers (0)
Find more on Axis Labels 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!