1
votes

I am currently generating a line graph using plotly express and this is the code I used.

fig = px.line(run, x="day", y= 'infected', title= 'Mass Testing at 60% Simulations')


fig.update_layout(
    xaxis_title="Day",
    yaxis_title= measure.capitalize(),
    legend_title = 'Quarantine Delay (Days)',
    title={
        'y':0.9,
        'x':0.5,
        'xanchor': 'center',
        'yanchor': 'top'}
)

py.plot(fig, filename= name + '.html')

This is what the dataset looks like:

enter image description here

It has 2 sets of days that are being compared. Plotly generates the lines I wanted but some reason a third line appears without any hover details appearing for that line (Highlighted in yellow on this picture).

enter image description here

I'm not really sure what is the problem, I double checked the dataset that there only has to be 2 sets of days being compared but somehow this 3rd line is being generated.

1

1 Answers

1
votes

It is your 'day' column - you could guess by the fact it is linear.