フィルターのクリア

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

5 ビュー (過去 30 日間)
Janez
Janez 2013 年 4 月 12 日
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

採用された回答

Sean de Wolski
Sean de Wolski 2013 年 4 月 12 日
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)
  1 件のコメント
Janez
Janez 2013 年 4 月 15 日
Thank you, it works. I love simple solutions ...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by