Possible to set new colors with a string color specifier?

The color specifier of a line can be set with 'b' for blue for example. Is it possible to this also for the new color order? Or is it possible to map somehow the "old" blue to the new blue, lighter blue? I would like to have the simple notation of the old color order with the new color order.

 採用された回答

Titus Edelhofer
Titus Edelhofer 2015 年 1 月 9 日

1 投票

Hi Stefan,
you can use this data:
c = get(0, 'DefaultAxesColorOrder');
plot(x, y, 'Color', c(1,:));
Titus

その他の回答 (2 件)

Guillaume
Guillaume 2015 年 1 月 9 日

1 投票

No, when you specify the colour 'b', it doesn't mean pick the blue colour in colororder, it means use the colour [0 0 1] regardless of what's in the colororder property.
There is no way to override this. (see ColorSpec in the doc).

1 件のコメント

Stefan Gachter
Stefan Gachter 2015 年 1 月 9 日
Thanks for your reply. Is it possible to access the color of the "colororder"? Something like
plot(x, y, 'Color', colororder(1))

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

Image Analyst
Image Analyst 2015 年 1 月 9 日

0 投票

See my demo (attached below this image that it creates) for changing the default color order.

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by