Get default line colour cycle

In matplotlib versions >= 1.5, you can print the rcParam called axes.prop_cycle:

print(plt.rcParams['axes.prop_cycle'].by_key()['color'])

# [u'#1f77b4', u'#ff7f0e', u'#2ca02c', u'#d62728', u'#9467bd', u'#8c564b', u'#e377c2', u'#7f7f7f', u'#bcbd22', u'#17becf']

Or equivalently, in python2:

print plt.rcParams['axes.prop_cycle'].by_key()['color']

In versions < 1.5, this was called color_cycle:

print plt.rcParams['axes.color_cycle']

# [u'b', u'g', u'r', u'c', u'm', u'y', u'k']

Note that the default color cycle changed in version 2.0.0 http://matplotlib.org/users/dflt_style_changes.html#colors-in-default-property-cycle

Leave a Comment