Distinct colors for plotting two columns of a single matrix

5 ビュー (過去 30 日間)
Edward Dow
Edward Dow 2011 年 2 月 2 日
I have vector called x(500,2). I plot(x) and I get a blue line for column 1 and a green line for column 2. I would like a red line for contrast purposes for column 2.

採用された回答

the cyclist
the cyclist 2011 年 2 月 2 日
One of several ways:
x = rand(4,2);
h = plot(x);
set(h(1),'Color','b');
set(h(2),'Color','r');
  1 件のコメント
Edward Dow
Edward Dow 2011 年 2 月 3 日
Simple fix! Thank you.

サインインしてコメントする。

その他の回答 (1 件)

Vieniava
Vieniava 2011 年 2 月 2 日

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by