How to change colors in Scatter plot?

31 visualizaciones (últimos 30 días)
Rehab Ali
Rehab Ali el 14 de Oct. de 2016
Comentada: Walter Roberson el 15 de Oct. de 2016
How to change colors in Scatter plot? I need to change the default colors "dark red and dark blue" into "light red and light green"

Respuestas (1)

KSSV
KSSV el 14 de Oct. de 2016
x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
RGB = [255 153 153]/256 ;
RGB = [204 204 255]/256 ;
scatter(x,y,[],RGB)
Choose your required color RGB array.
  5 comentarios
Walter Roberson
Walter Roberson el 15 de Oct. de 2016
You missed the point size parameter
scatter(xX, yX, 5, RGB, 'filled')
Walter Roberson
Walter Roberson el 15 de Oct. de 2016
I recommend:
coltab = [255 153 153; 204 204 255];
RGB = coltab(z(:), :);
pointsize = 5;
scatter(x, y, pointsize, RGB, 'filled');

Iniciar sesión para comentar.

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by