How to plot multiple lines in predefined colors ?

48 ビュー (過去 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 Center および File ExchangeAxis Labels についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by