How to plot multiple lines in predefined colors ?

조회 수: 52 (최근 30일)
Ole
Ole 2020년 8월 6일
답변: Arthur Roué 2020년 8월 6일
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일
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,:));

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by