How to change colors in Scatter plot?

조회 수: 30 (최근 30일)
Rehab Ali
Rehab Ali 2016년 10월 14일
댓글: Walter Roberson 2016년 10월 15일
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
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
Walter Roberson 2016년 10월 15일
You missed the point size parameter
scatter(xX, yX, 5, RGB, 'filled')
Walter Roberson
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 CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by