Help: Graphing 1 line with 2 colors in plotly express

I see. I think that it is more because px.line does not recognize the “skipped” points (maybe timestamps, not sure what the x-axis is…).

You can try to force it by filling the values in the 0 curve with nans when the points in curve 1 are defined. In other words, replace your y column by two columns, one for 0 and the other for 1.

1 Like