Reputation: 188
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:
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).
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.
Upvotes: 1
Views: 259
Reputation: 12927
It is your 'day' column - you could guess by the fact it is linear.
Upvotes: 1