3d plot with +Y up and +Z left

14 次查看(过去 30 天)
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 个评论
William Rose
William Rose 2025-11-15,1:53
@Mathieu NOE, if you change you comment to an answer, I would like to accept it.
Mathieu NOE
Mathieu NOE 2025-11-17,9:01
that's very kind - will do
have a nice day

请先登录,再进行评论。

采纳的回答

Mathieu NOE
Mathieu NOE 2025-4-8
移动:Mathieu NOE 2025-11-17,9:02
well if nothing works as expected I would probably end up doing a small function that plots my own referential as big X,Y,Z arrows in the main figure depending on which view options you have opted for
basta cosi

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by