Difference between pcolor and contourf
이전 댓글 표시
I'm trying to understand what the difference is between pcolor and contourf. If I have a 2D data, stored in variable Z, that I would like to plot, is there a difference between:
pcolor(X,Y,Z)
shading flat
AND
contourf(X,Y,Z)
shading flat
?
채택된 답변
추가 답변 (2개)
Star Strider
2014년 7월 6일
5 개 추천
The pcolor function uses the values of the adjacent points to determine the colors of the enclosed cell. So the color is defined by the points enclosing the cell, not the value of the function within the cell. From the documentation for pcolor (where C is its (MxN) matrix argument):
- A pseudocolor plot is a rectangular array of cells with colors determined by C. MATLAB® creates a pseudocolor plot using each set of four adjacent points in C to define a surface rectangle (i.e., cell).
Give the same data to both pcolor, image and contourf to see the difference.
댓글 수: 3
David C
2014년 7월 17일
Image Analyst
2014년 7월 17일
To make up for that, I gave him 2 points by voting for it. You can also vote in addition to accepting (if you haven't already).
Star Strider
2014년 7월 17일
Thank you both!
Shafiullah
2015년 5월 13일
0 개 추천
please, help me I am implementing contours on mammogram image, Although I am getting right segmentation but i want the contour to be filled inside with some color.
[c h] = contour(u ,[0 0],'linecolor','r'); is simple contour with red colored line, now i want same contour but filled inside with redcolor.
i have tried contourf(u ,[0 0],'faceColor','r'); but it causes my whole image darker and invisible.
Suggest me please.
댓글 수: 1
Image Analyst
2015년 5월 13일
Do your segmentation to get a mask (binary image), then use patch() or fill().
Also see these:
카테고리
도움말 센터 및 File Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!