The default colors of plotly (when using the default template) are plotly.colors.qualitative.Plotly
(see https://plot.ly/python/discrete-color/#color-sequences-in-plotly-express), which is a list, so you could assign to your traces colors from this list. You can also change the layout colorway (https://plot.ly/python/reference/#layout-colorway) to impose that the first two traces always have the same color, for example – but again you have to say which color (this solution was suggested in How do I force identical colors for all plots in a subplot?). Other than that I don’t think it’s possible to let plotly choose the color for you but impose that it’s the same color for two traces.
3 Likes