surface plots with different views

조회 수: 26 (최근 30일)
Joseph
Joseph 2014년 4월 3일
답변: Star Strider 2014년 4월 3일
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')

답변 (1개)

Star Strider
Star Strider 2014년 4월 3일
I suggest experimenting with the ‘ view ’ function to see if it does what you want.

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by