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
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
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 CenterFile Exchange 中查找有关 Polygons 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by