I am drawing a plot that has two lines with the following code. I have enabled legend but it is not rendered. What should be the reason for this?
figure = go.Figure(px.line(x=[1,2,3],
y=[2,4,6],
markers=True,
))
figure.add_hline(y=3, line_width=1.5, line_dash='dash',
line_color='green', name='line label')
figure.update_traces(
marker_size=5,
marker_line=dict(width=2, color='red'))
figure.update_layout(
title='My title',
yaxis_title='Y title',
xaxis_title='X title',
showlegend=True
)
figure.add_hline(y=24, line_width=1.5, line_dash='dash',
line_color='green', name='trace 0')
