How to change colors in Scatter plot?
32 次查看(过去 30 天)
显示 更早的评论
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"
0 个评论
回答(1 个)
KSSV
2016-10-14
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 个评论
Walter Roberson
2016-10-15
You missed the point size parameter
scatter(xX, yX, 5, RGB, 'filled')
Walter Roberson
2016-10-15
I recommend:
coltab = [255 153 153; 204 204 255];
RGB = coltab(z(:), :);
pointsize = 5;
scatter(x, y, pointsize, RGB, 'filled');
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!