How to draw contour lines into a filled 2-D patch object?

11 ビュー (過去 30 日間)
Paul
Paul 2013 年 1 月 16 日
Hallo!
I have a filled 2-D patch object as a figure, for example like this one:
Now I would like to draw level lines into this image, which limits areas of different values (color values). Furthermore I would like to set the number of level lines on my own (1 line, which separates 2 areas; 2 lines, which separate 3 areas; etc...).
I know there is the 'contour' or 'contourf' commands, which deal with my issue. But in my case I have a patch image and would like to keep this image and just draw the level lines into this image.
The patch object is of this form: 'patch(X,Y,C,'PropertyName',propertyvalue...)'

回答 (1 件)

Jan
Jan 2013 年 1 月 16 日
What about drawing a contour plot on top of this patch?
  2 件のコメント
Paul
Paul 2013 年 1 月 16 日
The problem is:
When I use contour(Z) or contourf(Z), I need a matrix Z, which is a n-m-Matrix containing the values. Now how to transform my patch object into a matrix Z? Or how can contour be used on a patch?
Jan
Jan 2013 年 1 月 17 日
contour cannot be used on a patch, but only in the same axes as the patch, such that the drawing appear on top of each other. You do not have to convert a patch in a matrix, but you need the values only. And these values should be available, when you create the patch object.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by