Increasing number of interpolating color in patch

1 回表示 (過去 30 日間)
Shan  Chu
Shan Chu 2019 年 4 月 12 日
コメント済み: Walter Roberson 2019 年 4 月 13 日
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 Center および File ExchangePolygons についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by