How to plot multiple lines in predefined colors ?

How to plot multiple lines with different predefined colors
CM = jet(2);
x= linspace(1,10,10);
y1 = x.^2; y2 =x.^3;
plot(x,y1,CM(1,:),x, y2, CM(2:)) %what is the correct entry here for the color CM(1,:)

답변 (1개)

Arthur Roué
Arthur Roué 2020년 8월 6일

1 개 추천

CM = jet(2);
x = linspace(1,10,10);
y1 = x.^2; y2 =x.^3;
plot(x, y1, 'Color', CM(1,:)); hold on
plot(x, y2, 'Color', CM(2,:));

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

제품

태그

질문:

Ole
2020년 8월 6일

답변:

2020년 8월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by