title: Plotly Python: Align X-Axes in a grouped bar chart with multiple Y-axis
body: <p>I have a grouped bar chart with two y axis each of them on a different scale. I am trying to align x-axis(y=0) of both the groups. I found few links <a href="https://stackoverflow.com/questions/36101767/python-plotly-align-y-axis-for-scatter-and-bar">link1</a> and <a href="https://stackoverflow.com/questions/35880139/multiple-y-axis-on-graph-not-aligned?noredirect=1&amp;lq=1">link2</a> in which setting <strong>rangemode='zero'</strong> should work, however my data consists of negative values due to which I guess setting rangemode to zero isn't working.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import plotly.offline as plt
  import plotly.graph_objs as go
  traces = [go.Bar(x=[1,2,3,4], y=[-1,2,-3,4], name='y actual'), 
            go.Bar(x=[1], y=[0], name='y dummy', hoverinfo='none', showlegend=False), 
            go.Bar(x=[1],y=[0],yaxis='y2', name='y2 dummy', hoverinfo='none', showlegend=False),
            go.Bar(x=[1,2,3,4], y=[22, 2, 13, 25], yaxis='y2', name='y2 actual')]
  layout = go.Layout(barmode='group',
                     yaxis=dict(title='y actual', rangemode="tozero", anchor='x', overlaying='y2'),
                     yaxis2=dict(title='y2 actual', side='right', rangemode = "tozero", anchor='x'))
  fig = go.Figure(data=traces, layout=layout)
  plt.iplot(fig)
  </code></pre>
  
  <p>The plot generated by the above code:
  <a href="https://i.stack.imgur.com/N7HR9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N7HR9.png" alt="enter image description here"></a></p>
  
  <p>How do I fix this?</p>
  
  <p>Note: You can see two dummy traces in the code. I introduced them so that the two traces 'y actual' and 'y2 actual' don't overlay over one another. For more info on why I did that checkout this <a href="https://github.com/plotly/plotly.js/issues/78#issuecomment-175301348" rel="nofollow noreferrer">link</a>  </p>