[Matplotlib-users] easily accessing the default color cycle list

Michael Kaufman kaufmanmc at ornl.gov
Tue Jan 10 13:04:49 EST 2017


That helps very much actually. Thanks.

Is this documented somewhere? It's not in plot() help.

M

On 1/10/17 1:01 PM, Ilya Flyamer wrote:
> Hi Michael,
>
> I think the new colours can be used as 'C0', 'C1', etc, if that helps?
>
> Ilya
>
> 2017-01-10 17:57 GMT+00:00 Michael Kaufman <kaufmanmc at ornl.gov
> <mailto:kaufmanmc at ornl.gov>>:
>
>     Hi All,
>
>     With the new color cycle, it's no longer super easy for me to
>     manually set plotting colors (that still conform to the new default
>     colors) without a cheat sheet.
>
>     Recently I've been doing:
>
>     cols = rcParams['axes.prop_cycle'].by_key()['color']
>
>     to get the list. This is something that I cannot remember and have
>     search through old code to find every time.
>
>     Is there an easier way to access this list? Something like:
>
>     from matplotlib.colors import color_cycle
>     cols = color_cycle('default')
>
>     would be quite nice. Maybe something like this already exists?
>
>
>     M
>     _______________________________________________
>     Matplotlib-users mailing list
>     Matplotlib-users at python.org <mailto:Matplotlib-users at python.org>
>     https://mail.python.org/mailman/listinfo/matplotlib-users
>     <https://mail.python.org/mailman/listinfo/matplotlib-users>
>
>



More information about the Matplotlib-users mailing list