I have the plot as you can see above. Now I want to add a range to the yaxis and yaxis2, but when I do this the bar and line in my plot doesn't allign anymore like the plot above. How to fix this so the bar and line will allign? See the code below with the range parameter in it (so the code of the plot above is without the range parameter and is correct):
import plotly.graph_objects as go
bar_trace = go.Bar(x=line_s['Year/Quarter'], y=line_s['test1'], name='test1')
line_trace1 = go.Scatter(x=line_s['Year/Quarter'], y=line_s['test2'],
name='test2', yaxis='y2', mode='lines+markers',
line=dict(color='orange'))
layout = go.Layout(title='test', yaxis=dict(title='test', range=[-320000,
21000]), yaxis2=dict(title='test', overlaying='y',
side='right', tickmode="sync", range=[-15, 5]),
legend=dict(x=1.06))
fig = go.Figure(data=[bar_trace, line_trace1], layout=layout)
fig.show()
Now I get this which is incorrect: