我正在绘制不同颜色的分组散点图。我让Matlab决定颜色,并使用平面映射到(默认?)颜色映射中。组线与分散组相同颜色
我需要使用相同的颜色与分散组中的行相同。
但是,行的默认ColorOrder
与scatter的不同。因此,重置ColorOrderIndex
不能解决问题。
目前我能产生follwing:
有:
% Data
N = 3;
T = 5;
xm = [6.3327 4.5682 6.1398
7.6289 5.4423 10.5246
3.5362 6.2185 8.2151
6.6572 9.4543 7.4266
6.1138 8.6453 8.2044];
ym = [7 0 7
11 0 55
1 1 18
14 6 12
8 2 22];
lm = [6.8176 0.3609 6.9693
13.0347 0.5587 62.4217
1.6841 0.8237 19.6712
8.0186 4.1533 13.2623
6.1108 2.7716 19.5666]
% Scatter groups
g = kron((1:N)',ones(T,1)); %// '
hs = scatter(xm(:),ym(:),[],g,'filled');
hold on
% Poisson group-fits
[xmsorted,posxm] = sort(xm);
posxm = bsxfun(@plus, (0:N-1)*T, posxm);
hl = plot(xmsorted,lm(posxm));
我试图让从分散的CDATA
,它基本上是我的g
(群系数),并且使用它直接索引到默认的颜色映射,但似乎散射使用不同的颜色映射?
您的示例需要工具箱。做任何[这些](http://stackoverflow.com/questions/30183701/reset-colororder-index-for-plotting-in-matlab-octave)有帮助吗? [Luis'回答'ColorOrderIndex''属性](http://stackoverflow.com/a/30185215/2748311)可能是最简单的。 – excaza
@excaza感谢您指出tb依赖关系,我对数据进行了硬编码。这正是我所说的使用不同的色彩图分散,重置ColorIndex没有效果。 – Oleg
对于那些标记重复的人:我不认为这是链接问题的重复。这与ColorOrderIndex无关。 – zeeMonkeez