Black Lives Matter. Please consider donating to Black Girls Code today.

Control the colors of the chart

Is there a way to control the color of the chart?
For instance I have two time series plotted on chart with two colors blue and orange. Now I added the third time series to the chart and the new color for the recently added time series is green. Then I delete the orange time series (the second one) and the third time series becomes orange which is confusing to the user since s/he is used to see the orange chart associated with the second time series, now suddenly the third time series colored orange (used to be green).


Could you post a screenshot of your results to make it clearer for us? It sounds like something’s wrong, are you using plotly.graph_objs?

I’m using plotly.graph_objs. The top plot shows 3 traces: trace1: blue, trace2: orange and trace3: green. Since the bottom plot does not have trace2, the trace3 takes the color of trace2.

Is there a way to specify what trace takes what color of Scatter plot?