def set_lines_color_cycle_map(name, length): cmap = getattr(plt.cm, name) c = cycler('color', cmap(np.linspace(0, 1, length))) matplotlib.rcParams['axes.prop_cycle'] = c