How to change colors in Scatter plot?
古いコメントを表示
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"
回答 (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 件のコメント
Rehab Ali
2016 年 10 月 14 日
KSSV
2016 年 10 月 14 日
clc; clear all ;
x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
RGB1 = repmat([255 153 153]/256 ,length(x)/2,1) ;
RGB2 = repmat([204 204 255]/256 ,length(x)/2,1) ;
RGB = [RGB1 ; RGB2] ;
scatter(x,y,[],RGB)
Rehab Ali
2016 年 10 月 15 日
編集済み: Walter Roberson
2016 年 10 月 15 日
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');
カテゴリ
ヘルプ センター および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!