How to get line color when fig.data[key].line.color not set

Hi there,

I have a graph with some lines and I’m trying to get the color of those lines. I expected this information in

fig.data[key].line.color

but since I didn’t specify the colors when I created the graph, the colors are being chosen automatically and fig.data[key].line.color doesn’t exist (or is None respecively).

Where can I find the color information for my lines?

Thanks for your help.

Hi,

The default colors are specified in the template, so fig.layout.template.layout.colorway should have them.

1 Like