3d plot with +Y up and +Z left

5 次查看(过去 30 天)
William Rose
William Rose 2025-4-8
评论: William Rose about 5 hours 前
When I plot a side view of a 3D object, with +Y axis up and +Z pointing left, the axis labels are in the wrong place or absent. See script and figure below. The script shows 2D views of a 3D object. The frontal and axial views, on the left side of the figure below, are fine. For the third view ("left lateral view"), I want +Y up and +Z pointing to the left (i.e. +X is into the screen). The code below plots the ellipsoid correctly, in the desired orientation, in the two plots on the right, but the axis labels are not OK. In th top right plot, the horizontal axis overlaps the title. In the bottom right plot, axis labels and ticks and tick labels are missing from both axes.
Example:
[X,Y,Z]=ellipsoid(0,0,0,3,9,1);
figure;
subplot(2,2,1); % this plot is OK
surf(X,Y,Z,'EdgeColor','none');
xlabel('X'); ylabel('Y'); zlabel('Z');
axis equal;
xlim([-10,10]); ylim([-10,10]); zlim([-10,10])
view(0,90); title('Frontal View');
subplot(2,2,3); % this plot is OK
surf(X,Y,Z,'EdgeColor','none');
xlabel('X'); ylabel('Y'); zlabel('Z');
axis equal;
xlim([-10,10]); ylim([-10,10]); zlim([-10,10])
view(0,0); title('Axial View')
subplot(2,2,2); % this plot is not OK
surf(X,Y,Z,'EdgeColor','none');
xlabel('X'); ylabel('Y'); zlabel('Z');
axis equal;
xlim([-10,10]); ylim([-10,10]); zlim([-10,10])
view([-1 0 0]); camup([0,1,0]);
title('Left Lateral View');
subplot(2,2,4); % this plot is not OK
surf(X,Y,Z,'EdgeColor','none');
xlabel('X'); ylabel('Y'); zlabel('Z');
axis equal;
xlim([-10,10]); ylim([-10,10]); zlim([-10,10])
campos([-1 0 0]); camup([0,1,0]);
title('Left Lateral View');
See here for a related discussion which does not answer my question. Thank you.
  4 个评论
Mathieu NOE
Mathieu NOE 2025-4-10
my pleasure ! (was not abig work either :))
William Rose
William Rose about 5 hours 前
@Mathieu NOE, if you change you comment to an answer, I would like to accept it.

请先登录,再进行评论。

回答(0 个)

类别

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