How to draw contour lines into a filled 2-D patch object?
조회 수: 13 (최근 30일)
이전 댓글 표시
Hallo!
I have a filled 2-D patch object as a figure, for example like this one:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150480/image.jpeg)
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...)'
댓글 수: 0
답변 (1개)
Jan
2013년 1월 16일
What about drawing a contour plot on top of this patch?
댓글 수: 2
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 Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!