[討論] Legend與plot顏色不同該如何改

作者: kate723 (凱特)   2015-11-05 14:06:06
想請教各位高手,因為Matlab底子薄弱,所以上來請教>"<
我有12個數據,也已經改成12種顏色,但是現在遇到
legend裡面的顏色和我改的顏色並不一樣,請問該如何改起
謝謝!! QAQ
colour_teal = [18 150 155] ./ 255;
colour_lightgreen = [94 250 81] ./ 255;
colour_green = [12 195 82] ./ 255;
colour_lightblue = [8 180 238] ./ 255;
colour_darkblue = [1 17 181] ./ 255;
colour_yellow = [251 250 48] ./ 255;
colour_peach = [251 111 66] ./ 255;
colour_darkpink = [207 0 77] ./ 255;
colour_darkpurple = [183 33 113] ./ 255;
colour_grey= [164 168 190] ./ 255;
colour_orange = [234 54 9] ./ 255;
colour_pinkorange = [249 169 149] ./ 255;
plot(1:622,EW2(:,1),'color',colour_teal);hold on
plot(1:622,EW2(:,2),'color',colour_lightgreen);
plot(1:622,EW2(:,3),'color',colour_green);
plot(1:622,EW2(:,4),'color',colour_lightblue);
plot(1:622,EW2(:,5),'color',colour_darkblue);
plot(1:622,EW2(:,6),'color',colour_yellow);
plot(1:622,EW2(:,7),'color',colour_peach);
plot(1:622,EW2(:,8),'color',colour_darkpink);
plot(1:622,EW2(:,9),'color',colour_darkpurple);
plot(1:622,EW2(:,10),'color',colour_grey);
plot(1:622,EW2(:,11),'color',colour_orange);
plot(1:622,EW2(:,12),'color',colour_pinkorange);
hold off
legend('0201','0202','0203','0204','0205','0206','0207','0208',...
'0209','0210','0211','0212')
set(gca,'xtick',[1,122,398],'xticklabel',year,'fontsize',fonts);
xlabel('year')
ylabel('E (mm)')
title('DS02');
作者: sunev (Veritas)   2015-11-05 14:33:00
沒問題啊?

Links booklink

Contact Us: admin [ a t ] ucptt.com