title: Adding a secondary axis in Plotly Python
body: <p>I'm working with a Dash graph object and I'm fairly new to it. I'm attempting to pass in a graph that has 2 scatter charts and a bar chart on the same figure but I'd like the bar chart (green) to be on it's own secondary y axis so it looks better than it does here:</p>
  
  <p><a href="https://i.stack.imgur.com/wGczP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wGczP.png" alt="enter image description here"></a></p>
  
  <p>Now from what I understand about Dash, I have to pass a <code>go.Figure()</code> object so I have a function which defines the <code>data</code> and the <code>layout</code>. I saw in the plotly documentation that you can use plotly express add secondary axis but I'm not sure how to do that within my frame work here. Any help would be greatly appreciated!</p>
  
  <p>Here's my code:</p>
  
  <pre><code>def update_running_graph(n_intervals):
      df = pd.read_csv(filename)
  
      trace1 = go.Scatter(x=df['Timestamp'],
                          y=df['CLE'],
                          name='Crude',
                          mode='lines+markers')
      trace2 = go.Scatter(x=df['Timestamp'],
                          y=df['y_pred'],
                          name='Model',
                          mode='lines+markers')
      trace3 = go.Bar(x=df['Timestamp'],
                      y=df['ModelDiff'],
                      name='Diff',
                      )
      data = [trace1, trace2,trace3]
      layout = go.Layout(title='CLE vs Model')
      return go.Figure(data=data, layout=layout)
  </code></pre>