필터 지우기
필터 지우기

Assigning correct symbols and colors to group scatterplot

조회 수: 14 (최근 30일)
Luís Henrique Bordin
Luís Henrique Bordin 2024년 7월 2일 15:52
댓글: Voss 2024년 7월 2일 17:53
Dear all, could you help me please on a group scatter plot?
I have three regions (MSD, DPG and WFS) and four seasons (Winter, Spring, Summer and Autumn). I chose four colors to represent the seasons, and 3 symbols to represent the regions, however, the function doesn't understand this way. The symbols are correct to each region, but the colors are inconsistent, I think it is because there are 3 regions, but 4 seasons. The thing is, I need always the same color to the same season at each region/symbol, but I could not figure it out yet. Please, could you help me? The data is attached and the code below. Thank you very much in advance!
load gscat.mat
gscatter(x,y,g,'rkgb','o*h',6,'on','Hind','Twin')
legend('Location','northeastoutside')

채택된 답변

Voss
Voss 2024년 7월 2일 16:02
load gscat.mat
gscatter(x,y,g,repelem('rkgb',1,3),repmat('o*h',1,4),6,'on','Hind','Twin')
legend('Location','northeastoutside')
  댓글 수: 2
Luís Henrique Bordin
Luís Henrique Bordin 2024년 7월 2일 17:08
Great!
Thank you very much, Voss!
All the best!
Luis
Voss
Voss 2024년 7월 2일 17:53
You're welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by