How to plot multiple surfaces on different planes in the same plot?
조회 수: 17 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!