how does the gplotmatrix color?
3 次查看(过去 30 天)
显示 更早的评论
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]
0 个评论
采纳的回答
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)'
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!