If I create colors by e.g:
import numpy as np from matplotlib import pyplot as plt n = 6 color = plt.cm.coolwarm(np.linspace(0.1,0.9,n)) color
For Matplotlib 2.2, using the cycler module will do the trick, without the need to convert to Hex values.
cycler
import cycler n = 100 color = pyplot.cm.viridis(np.linspace(0, 1,n)) mpl.rcParams['axes.prop_cycle'] = cycler.cycler('color', color)