3d plot with +Y up and +Z left

14 visualizaciones (últimos 30 días)
William Rose
William Rose el 8 de Abr. de 2025
Movida: Mathieu NOE el 17 de Nov. de 2025 a las 9:02
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 comentarios
William Rose
William Rose el 15 de Nov. de 2025 a las 1:53
@Mathieu NOE, if you change you comment to an answer, I would like to accept it.
Mathieu NOE
Mathieu NOE el 17 de Nov. de 2025 a las 9:01
that's very kind - will do
have a nice day

Iniciar sesión para comentar.

Respuesta aceptada

Mathieu NOE
Mathieu NOE el 8 de Abr. de 2025
Movida: Mathieu NOE el 17 de Nov. de 2025 a las 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

Más respuestas (0)

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by