Borrar filtros
Borrar filtros

Contour plot - how to show contours of irregular body in XY plane?

7 visualizaciones (últimos 30 días)
Hi all
I use contour(X,Y,Z,n) function and it works fine. However, sometimes I would like to show only one part of the contours which are in top view (X-Y plane) within body of irregular shape. Something similar like "inpolygon".
Is anybody having an idea how to show only contours within selected area?
Thanks, Janez

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 12 de Abr. de 2013
You could replace the values that you don't want with NaNs. For example:
[x,y,z] = peaks;
subplot(121)
contourf(x,y,z)
z(abs(z)<0.5) = nan;
subplot(122)
contourf(x,y,z)

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by