Increasing number of interpolating color in patch
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all,
I have created a patch with the color varying between two random colors. However, I would like to increase the number of interpolating colors.
Here we can see the shading are quite obvious.
Could you please help
x = [0 1 1 0];
y = [0 0 1 1];
c1 = [0.55 0.95 0.35];
c2 = [.65 .75 .55];
cdata(1,1,:) = c2;
cdata(1,2,:) = c2;
cdata(1,3,:) = c1;
cdata(1,4,:) = c1;
p =patch(x,y,'k');
set(p,'CData',cdata, ...
'FaceColor','interp', ...
'EdgeColor','none');
댓글 수: 7
David Wilson
2019년 4월 13일
I agree, the banding problem is quie subtle, and could well be an issue with your monitor.
One option is to subdivide your patch into say quadrants, and then interpolate the RGB values accordingly, and then plot all 4 as 4 separate patches. I'm assuming that will double the effective resolution & therefore reduce the banding.
Walter Roberson
2019년 4월 13일
When I look at the grayscale picture on my smartphone, then I can just barely see a band near the top, and only by scrolling back and forth. I might see a second band, but it is down in the level where it could be the power of suggestion. When I look at the grayscale picture on my iMac 27", I cannot reliably see any banding.
I also tried with using [0 0 0] [1 0 0] [0 1 0] [0 0 1] in the four corners. I could not see any banding at all.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!