Discussion:
[Matplotlib-users] Set matplotlibrc color cycle to custom colors using axes.prop_cycle (v1.5)
Julian Irwin
2015-12-21 01:55:47 UTC
Permalink
Hi,

I'm trying to set my default color cycle in my matplotlibrc using
axes.prop_cycle. The documentation (as far as I could find...) only gives
examples like

axes.prop_cycle : cycler('color', 'bgrcmyk')


And then the comment below says, cryptically:

# as list of string colorspecs:
# single letter, long name, or
# web-style hex

But I have tried all sorts of variatns on:

axes.prop_cycle : cycler('color', ['#e41a1c', '#377eb8', '#4daf4a',
'#ff7f00', '#a65628', '#f781bf', '#999999', '#984ea3', '#ffff33'])

But I always get an error upon importing matplotlib. Is there any doc on
how to do this properly? Is this even supported?

Thanks,
Julian
Thomas Caswell
2015-12-21 05:51:40 UTC
Permalink
Not at a computer to test, but try dropping the quotes.
Post by Julian Irwin
Hi,
I'm trying to set my default color cycle in my matplotlibrc using
axes.prop_cycle. The documentation (as far as I could find...) only gives
examples like
axes.prop_cycle : cycler('color', 'bgrcmyk')
# single letter, long name, or
# web-style hex
axes.prop_cycle : cycler('color', ['#e41a1c', '#377eb8', '#4daf4a', '#ff7f00', '#a65628', '#f781bf', '#999999', '#984ea3', '#ffff33'])
But I always get an error upon importing matplotlib. Is there any doc on
how to do this properly? Is this even supported?
Thanks,
Julian
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Benjamin Root
2015-12-21 14:45:36 UTC
Permalink
You can't use the hash symbol when doing colors as a hex in an rcfile. The
rcfile parser is so simple that it treats it as a comment. Don't drop the
quotes.

Ben Root
Post by Thomas Caswell
Not at a computer to test, but try dropping the quotes.
Post by Julian Irwin
Hi,
I'm trying to set my default color cycle in my matplotlibrc using
axes.prop_cycle. The documentation (as far as I could find...) only gives
examples like
axes.prop_cycle : cycler('color', 'bgrcmyk')
# single letter, long name, or
# web-style hex
axes.prop_cycle : cycler('color', ['#e41a1c', '#377eb8', '#4daf4a', '#ff7f00', '#a65628', '#f781bf', '#999999', '#984ea3', '#ffff33'])
But I always get an error upon importing matplotlib. Is there any doc on
how to do this properly? Is this even supported?
Thanks,
Julian
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Julian Irwin
2015-12-21 20:33:13 UTC
Permalink
Ahh, the hashes were the problem!

Thanks for your help.

Julian
Post by Benjamin Root
You can't use the hash symbol when doing colors as a hex in an rcfile. The
rcfile parser is so simple that it treats it as a comment. Don't drop the
quotes.
Ben Root
Post by Thomas Caswell
Not at a computer to test, but try dropping the quotes.
Post by Julian Irwin
Hi,
I'm trying to set my default color cycle in my matplotlibrc using
axes.prop_cycle. The documentation (as far as I could find...) only gives
examples like
axes.prop_cycle : cycler('color', 'bgrcmyk')
# single letter, long name, or
# web-style hex
axes.prop_cycle : cycler('color', ['#e41a1c', '#377eb8', '#4daf4a', '#ff7f00', '#a65628', '#f781bf', '#999999', '#984ea3', '#ffff33'])
But I always get an error upon importing matplotlib. Is there any doc on
how to do this properly? Is this even supported?
Thanks,
Julian
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Loading...