This is a customization feature available in matlab and matplotlib (https://matplotlib.org/examples/color/color_cycle_demo.html), and I’m wondering if I’m using the wrong terminology to find this, or it’s just not available.
If I plot four line traces, by default they will use the “category10” colors, #1f77b4, #ff7f0e, #2ca02c, #d62728 (I think). Alternatively, I can set each trace color explicitly when I create it. What I want is to replace the figure’s color cycle list with a custom set, instead of the default category10, so the traces will use the colors from the custom set, in order, without being specified in the trace. Is this possible? This is useful for me because it allows me to maintain good separation between code that produces data for traces, and code that styles the traces.
My current “good enough” solution is this:
def set_color_cycle(traces):
for n, t in enumerate(traces):
color = color_cycle[n % len(color_cycle)]
if 'line' not in t:
t['line'] = {'color': color}
return traces