Possible to set new colors with a string color specifier?

3 views (last 30 days)
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.

Accepted Answer

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

More Answers (2)

Guillaume
Guillaume on 9 Jan 2015
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 Comment
Stefan Gachter
Stefan Gachter on 9 Jan 2015
Thanks for your reply. Is it possible to access the color of the "colororder"? Something like
plot(x, y, 'Color', colororder(1))

Sign in to comment.


Image Analyst
Image Analyst on 9 Jan 2015
See my demo (attached below this image that it creates) for changing the default color order.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!