How can I change the view of a surface plot from a specified point to a specific direction?
25 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I want to change the view of my surface plot {
} from
to a specific direction {
&
}
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377756/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377761/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377766/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377771/image.png)
i.e,
At
azimuth angle (ϕ)=?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377761/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377776/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377781/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377786/image.png)
elevation angle
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377806/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377791/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377796/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377801/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377806/image.png)
Hence, i want to view the surface from
to a direction (
&
)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377761/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377811/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377816/image.png)
so, how can I perform it? please help...
I have used the surfl() function to plot my 3d surface {
}
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/377756/image.png)
My Code is as follows:
x=-6:0.01:6;
y=x;
[xx yy]=meshgrid(x,y);
zz=xx.^2 + yy.^2;
surfl(xx,yy,zz);
colormap(gray) % change color map
shading interp % interpolate colors across lines and faces
xlabel('x-axis ->')
ylabel('y-axis ->')
zlabel('f(x,y) ->')
title('f(x,y)= x^2 + y^2')
4 件のコメント
VBBV
2020 年 10 月 12 日
編集済み: VBBV
2020 年 10 月 12 日
Use campos function
i%f true
% code
%end
campos([4 4 0])
x y z are locations along x y z directions of the graph. See more info in the link below https://in.mathworks.com/help/matlab/ref/campos.html
KSSV
2020 年 10 月 12 日
You have two options.
- You can use view, campos by providing the viewing point input coordinates.
- You can do it manually, you have a rotation icon in the plot. You can click on it and adjuxt to your required view point.
回答 (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!