I'm trying to use scatter in the same way I've always used it, to plot data in color, as in:
scatter(x,y, sz, dat,'filled')
where x, y and dat are m x 1 vectors and sz is just a single value (i.e. sz = 20). I get the following error:
Color must be one RGB triplet, an m-by-3 matrix of RGB triplets with one color per scatter point, or an m-by-1 vector with one value per scatter point.
This error occurs now with code I've run for years.
I recently had to reinstall Matlab due to a laptop failure and I'm using R2024b Update 2 on MacOS 15.1.1
Thanks.

댓글 수: 3

Walter Roberson
Walter Roberson 2024년 12월 11일
It seems to work for me, though I am on R2024b no update, but otherwise the same as you.
Adam Danz
Adam Danz 2024년 12월 12일
편집: Adam Danz 2024년 12월 12일
Could you provide the input variables used in scatter that reproduce the error?
Geno
Geno 2024년 12월 12일
Really can be any collection of usual vectors that have always worked, but here's one:
x = 1:100;
y = sin(x);
z = x.^2;
figure
scatter(x,y,20,z,'filled')
This is the scatter function being called:
/Applications/MATLAB_R2024b.app/toolbox/matlab/graphics/graphics/scatter.m

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2024년 12월 12일
이동: Cris LaPierre 2024년 12월 13일

2 개 추천

Please show the result of
which -all height
which -all width
You would encounter the RGB error if either height or width are not the MATLAB built-in functions.

댓글 수: 2

Geno
Geno 2024년 12월 12일
이동: Cris LaPierre 2024년 12월 13일
That did it. I had an old height.m in my path. Once I deleted that, scatter works again.
Thanks much!
Adam Danz
Adam Danz 2024년 12월 13일
Impressive, @Walter Roberson
I need to get a crystal ball toolbox license.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

릴리스

R2024b

태그

질문:

2024년 12월 11일

댓글:

2024년 12월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by