Matlab - 指定并行线条中的线条颜色

时间:2014-02-16 13:59:31

标签: matlab colors plot

我需要在parallelcoords中指定不同的颜色,但matlab自己选择颜色。我怎样才能改变它?

在文档中有一个例子:

% Make a grouped plot of the raw data
load fisheriris
labels = {'Sepal Length','Sepal Width',...
          'Petal Length','Petal Width'};
parallelcoords(meas,'group',species,'labels',labels);

它使用默认颜色。但是,如果我想指定不同的颜色(对于每个组),我该怎么办呢?

1 个答案:

答案 0 :(得分:1)

也许是这样的?

h=figure(1);
set(h,'DefaultAxesColorOrder',[1 1 0;0 1 1;0 0 1]);

load fisheriris
labels = {'Sepal Length','Sepal Width',...
          'Petal Length','Petal Width'};
parallelcoords(meas,'group',species,'labels',labels);

参考:http://www.mathworks.com/help/matlab/creating_plots/defining-the-color-of-lines-for-plotting.html