Borrar filtros
Borrar filtros

Increasing number of interpolating color in patch

1 visualización (últimos 30 días)
Shan  Chu
Shan Chu el 12 de Abr. de 2019
Comentada: Walter Roberson el 13 de Abr. de 2019
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 comentarios
David Wilson
David Wilson el 13 de Abr. de 2019
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 el 13 de Abr. de 2019
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.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by