2D contourplots of a 3D function

2 次查看(过去 30 天)
I have a 3D matrix; corresponding to values of function f in space. I would like to display 2D contourplots of f at certain planes(x=x0 or y=y0 or z=z0); and I need the contour plane(cross section) to appear at the right location in 3D space; for example: for a plot at z=1:
what's the best way to do this in matlab? I would like something that works similar to quiver3:
[X Y Z]=meshgrid(-6:1:6,-6:1:6,1);
quiver3(X,Y,Z,fx,fy,fz))
except for scalar f.
I tried surf; it only worked for Z=Z0 planes

采纳的回答

Patrick Kalita
Patrick Kalita 2012-4-11
I think you want to use slice.
  3 个评论
Walter Roberson
Walter Roberson 2012-4-11
Yes, have a look at datacursormode() . You customize the callback function to present whatever information you want.
A
A 2012-4-12
code would be appreciated! assume slice(X,Y,Z,f,0,[],[]). Want to make cursor display value of f.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by