2D contourplots of a 3D function

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

 Respuesta aceptada

Patrick Kalita
Patrick Kalita el 11 de Abr. de 2012

0 votos

I think you want to use slice.

3 comentarios

A
A el 11 de Abr. de 2012
yes looks like that's what I need. Is there a way to make data cursor on the figure display value of the volumetric data, instead of x y z coordinates?
Walter Roberson
Walter Roberson el 11 de Abr. de 2012
Yes, have a look at datacursormode() . You customize the callback function to present whatever information you want.
A
A el 12 de Abr. de 2012
code would be appreciated! assume slice(X,Y,Z,f,0,[],[]). Want to make cursor display value of f.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Centro de ayuda y File Exchange.

Preguntada:

A
A
el 9 de Abr. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by