Rotate 3D mesh plot to show 2D view of X data on vertical axis and Z data on horizontal axis

4 Ansichten (letzte 30 Tage)
Hello, I have this 3D mesh plot in R2023b:
I want to create a 2D view of this plot with the X data on the vertical axis, and the Z data on the horizontal axis.
Using view(0,0): this creates the correct planar view, but I now need to flip the axes:
Using camup([1 0 0]): this is close to what I want, but the horizontal (Z data) axis is undesirably flipped:
I then decided to try pairing view(180,0) with camup([1 0 0]) to see if this would force my desired orientation.
This is now the exact plot that I want, but the top placement of the Z data axis ruins the formmatting:
At this point, I simply want to either:
  1. Learn how to move the Z data axis down to the bottom of the plot.
  2. Perform this with a simpler set of commands.
Thanks, Charlie

Akzeptierte Antwort

Torsten
Torsten am 6 Sep. 2025
Bearbeitet: Torsten am 6 Sep. 2025
x = -2:0.1:2;
y = 0:0.1:1;
[X,Y]=meshgrid(x,y);
Z = X.^2+Y.^2;
mesh(Z,Y,X)
xlabel('Z')
ylabel('Y')
zlabel('X')
view(0,0)
  1 Kommentar
Charles Arentzen
Charles Arentzen am 8 Sep. 2025
Awesome! This gets the job done. Glad there's a way to reframe this so you don't need to preserve the original X Y Z order.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by