Hi everyone, I am working on a simple line plot off an imported Pandas CSV file which contains years and GDP values. I’m trying to get the solid line to change from a solid line to a dashed line after a certain year.
This is an example of one of the traces which works great in its current state:
trace_ukraine = go.Scatter(
x = gdp.Year,
y = gdp.Ukraine,
mode = ‘lines’,
name = “Ukraine”,
)
I want to add something like:
if x > 2018:
dash = “dash”
It’s just a matter of changing the line type after a certain year is met. I’ve tried different approaches inside the trace itself as well as after all of the traces in the code. If anyone understands how to do this, I would be very appreciative.