How to plot multiple surfaces on different planes in the same plot?
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sana Ahmed
am 5 Aug. 2019
Beantwortet: Star Strider
am 5 Aug. 2019
I have multiple surfaces that I want to display on the same plot but I want each one to be above the other (on different planes). How would I do that?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 5 Aug. 2019
One way would be to offset them by a constant:
[X,Y] = meshgrid(-2:0.1:2);
Z1 = X.^2 + Y.^2;
Z2 = X.^2 - Y.^2;
Z3 = cos(2*pi*X) + sin(2*pi*Y);
figure
surf(X, Y, Z1)
hold on
surf(X, Y, Z2+10)
surf(X, Y, Z3+20)
hold off
grid on
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!