surface plots with different views
조회 수: 26 (최근 30일)
이전 댓글 표시
my objective is to create four surface plots of the same function in the same window. I can easily create the 4 subplots.
my issue is coming with the different views. I need an isometric view, and views normal to the XY plane, XZ plane and YZ plane. Thanks for your help here is my code:
x = -10:1:10;
y = x;
[xGrid,yGrid] = meshgrid(x,y);
z = (1./((xGrid+3).^2 + (yGrid-1).^2 + 2)) + ((xGrid-yGrid) ./ ((xGrid-1) .^2 + (yGrid-2) .^2 + 4));
subplot(2,2,1)
surf(x,y,z)
title('Isometric View')
xlabel('X')
ylabel('Y')
zlabel('Z')
subplot(2,2,2)
surf(x,y,z)
view(0,0)
title('View Normal to X-Y Plane')
xlabel('X')
ylabel('Y')
zlabel('Z')
subplot(2,2,3)
surf(x,y,z)
view(0,0)
title('View Normal to X-Z Plane')
xlabel('X')
ylabel('Y')
zlabel('Z')
subplot(2,2,4)
surf(x,y,z)
view(0,0)
title('View Normal to Y-Z Plane')
xlabel('X')
ylabel('Y')
zlabel('Z')
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!