主题:请教,关于matlab作图颜色
如果我在一张图中,想画的线条超过8条,那么matlab的默认8种颜色就自动循环了,为了区分不同的线条,怎么能简单实现呢?我目前的方法很笨:
plot(a2(:,1),'-+','LineWidth',1.5,'color',[0 0 0]);
hold on
plot(a2(:,2),'-o','LineWidth',1.5,'color',[.9 .9 .9]);
plot(a2(:,3),'-*','LineWidth',1.5,'color',[1 0 0]);
plot(a2(:,4),'-x','LineWidth',1.5,'color',[0 1 0]);
plot(a2(:,5),'-d','LineWidth',1.5,'color',[0 0 1]);
plot(a2(:,6),'-^','LineWidth',1.5,'color',[1 0 1]);
plot(a2(:,7),'-v','LineWidth',1.5,'color',[0 1 1]);
plot(a2(:,8),'->','LineWidth',1.5,'color',[0.6 0 1]);
plot(a2(:,9),'-<','LineWidth',1.5,'color',[1 0.5 0]);
plot(a2(:,10),'-s','LineWidth',1.5,'color',[1 1 0]);
plot(a2(:,11),'-h','LineWidth',1.5,'color',[0.5 0 0]);
plot(a2(:,12),'-p','LineWidth',1.5,'color',[0.5 0.5 0.5]);
plot(a2(:,1),'-+','LineWidth',1.5,'color',[0 0 0]);
hold on
plot(a2(:,2),'-o','LineWidth',1.5,'color',[.9 .9 .9]);
plot(a2(:,3),'-*','LineWidth',1.5,'color',[1 0 0]);
plot(a2(:,4),'-x','LineWidth',1.5,'color',[0 1 0]);
plot(a2(:,5),'-d','LineWidth',1.5,'color',[0 0 1]);
plot(a2(:,6),'-^','LineWidth',1.5,'color',[1 0 1]);
plot(a2(:,7),'-v','LineWidth',1.5,'color',[0 1 1]);
plot(a2(:,8),'->','LineWidth',1.5,'color',[0.6 0 1]);
plot(a2(:,9),'-<','LineWidth',1.5,'color',[1 0.5 0]);
plot(a2(:,10),'-s','LineWidth',1.5,'color',[1 1 0]);
plot(a2(:,11),'-h','LineWidth',1.5,'color',[0.5 0 0]);
plot(a2(:,12),'-p','LineWidth',1.5,'color',[0.5 0.5 0.5]);