Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Plotly.express - add_scatter - specific color for each add_scatter

Hello,

I have an application that uses add_scatter on one plot based on the state of some radio buttons. Depending on the order in which I press those buttons the color of the lines on the plot changes during run time.

I was wondering if there is a way to give each add_scatter a certain color, something like:
if Button1 == “Plot 1”:
plot_1.add_scatter(y = y_values_1, x = x_values_1, color = ‘blue’)
if Button2 == “Plot 1”:
plot_1.add_scatter(y = y_values_2, x = x_values_2, color = ‘red’)