Multi line color in graph

3 ビュー (過去 30 日間)
Deepa Maheshvare
Deepa Maheshvare 2019 年 11 月 5 日
コメント済み: Star Strider 2019 年 11 月 7 日
Hi,
While trying to plot a graph
plot(1:10, rand(10,10))
Each line has a different color.
Is it possible to vary the color scale from a darker shade to lighter shade? For instance, from black to grey

採用された回答

Star Strider
Star Strider 2019 年 11 月 5 日
Try this:
cmap = colormap(gray(10));
figure
hp = plot(1:10, rand(10));
set(gca,'ColorOrder',cmap)
Experiment to get dufferent results.
  12 件のコメント
Deepa Maheshvare
Deepa Maheshvare 2019 年 11 月 7 日
Walter, I am uisng Windows OS. I upgraded from 2019a to 2019b. The solution that was posted earlier works fine now. Thank you
Star Strider
Star Strider 2019 年 11 月 7 日
@Deepa Maheshvare — Thank you for following up. I am happy that it worked for you.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by