how does the gplotmatrix color?

조회 수: 3 (최근 30일)
Jasmina Burek
Jasmina Burek 2018년 1월 26일
댓글: Jasmina Burek 2018년 2월 1일
gplotmatrix(OrigDataReduced,[],FinalAGClasses,[1 0 0; 0 0 0; 1 1 0; 0 0 0; 0 1 1; 0 0 0; 0.4940 0.1840 0.5560; 0 0 0; 0.3010 0.7450 0.9330; 0.6350 0.0780 0.1840; 0 0 0; 0 0 0],[],[20],false);
I want my plots to be colored in a specific order, but I don't understand in what order matlab assigns colors from FinalAGClasses - my numbers are: (I have 130 values with assigned class number).
class No
1 r [1 0 0]
4 k [0 0 0]
5 y [1 1 0]
10 k [0 0 0]
11 c [0 1 1]
16 k [0 0 0]
17 [0.4940 0.1840 0.5560]
18 k [0 0 0]
19 [0.3010 0.7450 0.9330]
20 [0.6350 0.0780 0.1840]
21 k [0 0 0]
22 k [0 0 0]

채택된 답변

Gaurav Phatnani
Gaurav Phatnani 2018년 2월 1일
>> gplotmatrix(x,y,group,clr,sym,siz,doleg)
The points specified by the 'x' and 'y' arguments of 'gplotmatrix' are categorized in groups using the third argument 'group'.
The points are colored based on the group they fall under. The color assigned to a group is the corresponding element in the 'clr' vector. For example, group 1 will be assigned the color 'clr(1)', group 2 will be 'clr(2)' and so on.
If the number of groups is greater than the number of elements in the 'clr' vector, the sequence repeats itself. For example, if there are 'n' groups and 'm' colors such that n>m then color of group 'm+1' will be 'clr(1)'
  댓글 수: 1
Jasmina Burek
Jasmina Burek 2018년 2월 1일
Thank you. I was confused because I used numbers only first so could not tell if it's by order or number value. But now when I replaced with text it is clear. Thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by