surface plots with different views

31 ビュー (過去 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 Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by