How to plot multiple surfaces on different planes in the same plot?

31 ビュー (過去 30 日間)
Sana Ahmed
Sana Ahmed 2019 年 8 月 5 日
回答済み: Star Strider 2019 年 8 月 5 日
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?

採用された回答

Star Strider
Star Strider 2019 年 8 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by