3D Surface plot - Surfc - alternate contour plane

6 次查看(过去 30 天)
I am trying to plot a 3D surface and a contour plot. This can be done by the surfc () command - which projects the top view contours onto the bottom plane, (i.e. the XY plane) However I need to project side view contours onto a side view plane (i.e the XZ or YZ plane). Can anyone help? Also I am wanting to be able to control the number and resolution of the contour levels.

回答(1 个)

Adam Filion
Adam Filion 2012-6-25
I'm not familiar with any way to directly take side view projections, but you can always flip your inputs to SURFC to get the projections you want, i.e.
[x,y,z] = peaks;
% x-y plane projection
surfc(x,y,z)
% x-z plane projection
surfc(x,z,y)
% y-z plane projections
surfc(y,z,x)
The SURFC command uses CONTOUR3 under the hood (you can see the source code by entering ‘edit surfc’ at the command line), and uses the default contour levels. As SURFC doesn’t return a handle to the contour levels, I don’t know of a simple way to change them. You could ways use the GET and SET commands to query and set the contours, but I would recommend making your own copy of SURFC (do not save over the shipping version) that will accept additional inputs so you could control the contours yourself by inputting them to CONTOUR3 inside of MY_SURFC.

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by