gscatter seems to be doing something wrong

Im using gscatter group plots. This is the code for one of them.
I make gscatter group the plots based on the values from datalim. This is a matrix with the same size as "data".
But this only works when H < 2.0. As soon as I put H >= 2.1 then it gives me the wrong colors.
H = 2.0;
for limx = 1:21
for limy = 1:12
if data(limx,limy) < Hs
datalim(limx,limy) = 1;
else
datalim(limx,limy) = 0;
end
end
gscatter(months,data(limx,:),datalim12(limx,:),'rg')
hold on
end

댓글 수: 1

SBRANS
SBRANS 2020년 10월 2일
thanks for the suggestion but you just added 'xo' right?

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

 채택된 답변

SBRANS
SBRANS 2020년 10월 2일

0 개 추천

I solved it by putting all my data into one column. It eliminates one for-loop and just works.

추가 답변 (0개)

카테고리

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

태그

질문:

2020년 10월 2일

편집:

2020년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by