title: how to add range to the secondary_y axis in plotly?
body: <p>I want to create a graph where I want to add range to the secondary y-axis. The graph which I have right now is like this.
  <a href="https://i.stack.imgur.com/Yq0gd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yq0gd.png" alt="enter image description here" /></a></p>
  <p>The code for this graph is like this:</p>
  <pre><code>import plotly.offline as pyo
  import plotly.graph_objs as go
  from plotly import tools
  from plotly.subplots import make_subplots
  import pandas as pd
  import xlwings as xw
  import logging
  
  fileName = 'solar data.xlsx'
  app = xw.App(visible=False)
  try:
      wb = app.books.open(fileName)
      sheet = wb.sheets[4]
      lastCell = sheet.range('A1').end('down').last_cell.row
  
      solarOne = sheet.range('B2:B'+ str(lastCell)).value
      bessOne = sheet.range('D2:D'+ str(lastCell)).value
      socOne = sheet.range('E2:E'+ str(lastCell)).value
      solarOne_Plus_bessOne = [i+j for i,j in zip(solarOne,bessOne)]
  
      # solarTwo = sheet.range('F2:F' + str(lastCell)).value
      # bessTwo = sheet.range('H2:H' + str(lastCell)).value
      # socTwo = sheet.range('I2:I' + str(lastCell)).value
      # solarTwo_Plus_bessTwo = [i + j for i, j in zip(solarTwo, bessTwo)]
  
  
  except Exception as e:
      logging.exception(&quot;Something awful happened!&quot;)
      print(e)
  finally:
      app.quit()
      app.kill()
  
  
  fig = go.Figure()
  projectTime = pd.date_range(&quot;2020-10-01 00:00:00&quot;, &quot;2020-10-01 23:59:00&quot;, freq=&quot;1T&quot;)
  
  fig = make_subplots(specs=[[{&quot;secondary_y&quot;: True}]])
  
  fig.add_trace(go.Scatter(x =  projectTime, y =  solarOne, name = 'Solar', fill='tozeroy', line=dict(width=0.5, color='rgb(255,167,0)')), secondary_y=False)
  fig.add_trace(go.Scatter(x =  projectTime, y =  bessOne, name = 'Storage', fill='tozeroy', line=dict(width=0.5, color='rgb(43, 201, 34)')), secondary_y=False)
  fig.add_trace(go.Scatter(x =  projectTime, y =  socOne, name = 'SoC', fill='tozeroy', line=dict(width=0.5, color='rgb(250, 67, 67)')), secondary_y=True)
  fig.add_trace(go.Scatter(x =  projectTime, y =  solarOne_Plus_bessOne, name = 'Solar + BESS', fill='tozeroy',), secondary_y=False)
  
  # Add figure title
  fig.update_layout(
      title_text=&quot;Solar with 0.5MW  0.5Hour storage&quot;
  )
  
  # Set x-axis title
  fig.update_xaxes(title_text=&quot;Time&quot;)
  
  # Set y-axes titles
  fig.update_yaxes(title_text=&quot;Dispatch(MW) and SoC(MWh)&quot;)
  
  pyo.plot(fig, filename='Solar with 0.5MW 0.5Hour storage example 1.html')
  </code></pre>
  <p>I have tried to add <code>layout_yaxis_range=[-0.6, 0.7]</code> in secondary y-axis but it throws an error</p>
  <pre><code>TypeError: add_trace() got an unexpected keyword argument 'layout_yaxis_range'
  </code></pre>
  <p>I want this secondary y-axis with the same x-axis. Can anyone please help?</p>