フィルターのクリア

How can i change colors of data in a 2D plot?

4 ビュー (過去 30 日間)
Umair  Ahmed
Umair Ahmed 2020 年 3 月 19 日
コメント済み: Ameer Hamza 2020 年 3 月 19 日
hi, i am making a 2D plot and have multiple data which i want to be different colors. i used colormaps (lines, parula, prism).. but proble with them is after 3-4 data points the same color gets repeated again and again, and i not able to distinguish between data? can anyone help?
Thanks
  1 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 3 月 19 日
The colors of lines made using plot() function is decided by the ColorOrder property of axes not Colormap.

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

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 3 月 19 日
編集済み: Ameer Hamza 2020 年 3 月 19 日
One way is to increase the colors in the ColorOrder property of the axes. For example, try
rng(0);
ax = axes();
ax.ColorOrder = rand(100, 3);
hold(ax);
%% now run the plot commands.
  4 件のコメント
Umair  Ahmed
Umair Ahmed 2020 年 3 月 19 日
great, thank you very much!
Ameer Hamza
Ameer Hamza 2020 年 3 月 19 日
Glad to be of help.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by