For some reason, the 0 for y-axis on the left does not at the same level with the one on the right (my GREEN drawing)
Here is my code:
fig = make_subplots(specs=[[{'secondary_y': True}]])
fig.add_trace(go.Bar(name='US Daily Tests',
x=merged_df.date,
y=merged_df.totalTestResultsIncrease,
marker_color='darkblue',
opacity=0.3))
fig.add_trace(go.Bar(name='US Daily New Cases',
x=merged_df.date,
y=merged_df.new_cases,
marker_color='darkblue'))
fig.add_trace(go.Scatter(name='Positive Rate',
x=merged_df.date,
y=merged_df.positive_rate,
opacity=0.8,
marker_color='rgb(255, 127, 14)'),
secondary_y="True")
fig.update_layout(
title={
'text': "COVID-19 Daily Numbers in United States",
'x':0.1},
barmode='overlay',
plot_bgcolor='rgb(245,245,245)',
legend=dict(
x=0.02,
y=0.95),
margin=dict(l=0, r=0, b=0, t=50)
)