I'm using Plotly to create a graph with two lines on the primary y axis and a bar chart on the secondary y axis showing the proportion of line2/line1.
The code is working fine but it is creating too many reference lines (the lines for the 1000, 2000, 3000... of the left axis and 1%, 2%, 3%... of the right axis).
Is it possible to align them? For example, 1000 and 1% would share the same reference line, or any other way that it always aligns both left and right axis.
Here is the code and the graph generate:
fig = make_subplots(specs=[[{'secondary_y': True}]])
fig.add_trace(go.Scatter(x=data['date'], y=data['y1'],
mode='lines+markers',
name='Y1'), secondary_y=False)
fig.add_trace(go.Scatter(x=data['date'], y=data['y2'],
mode='lines+markers',
name='Y2'), secondary_y=False)
fig.add_trace(go.Bar(x=data['date'], y=data['pct'],
name='PCT', opacity=0.5), secondary_y=True)
fig.update_layout(title=f'Graph', yaxis2=dict(tickformat='.2%'))



