I am trying to display 2 bar charts with 2 y-axes. However only the first bars are shown. If I set the second y to overlaying=‘y’ then they are shown with the second bar behind the first one.
How can I display them next to each other in the same way it would be displayed when using one y?
trace = []
trace.append(go.Bar(
x = [1,2,3,4,5],
y = [2,5,3,7,8],
name = “g1”,
)
)
trace.append(go.Bar(
x = [1,2,3,4,5],
y = [90,120,45,130,100],
name = “g2”,
yaxis=“y2”,
),
)
layout = go.Layout(title=“T”,
barmode=‘group’,
yaxis=dict(
title=“T1”,
rangemode=‘tozero’,
side=‘left’
),
yaxis2=dict(
title=“T2”,
rangemode=‘tozero’,
overlaying=‘y’,
side=‘right’
)
)
iplot(go.Figure(data=trace, layout=layout), filename=‘multiple-axes-double’)