title: Plotly: How to change the range of the y-axis of a subplot?
body: <p>I have the following code:</p>
  <pre><code>from plotly.subplots import make_subplots
  import requests 
  import json
  import datetime as dt
  import pandas as pd
  import plotly.graph_objects as go
  
  
  
  
  def get_candles(symbol, window, interval='1h'):
      url = &quot;https://api.binance.com/api/v1/klines&quot;
      end_time = dt.datetime.utcnow()
      delta = dt.timedelta(hours = window)
      start_time = end_time - delta
      start_date = str(int(start_time.timestamp() * 1000))
      end_date = str(int(end_time.timestamp() * 1000))
      limit = '1000'
      market = symbol + 'BUSD'
  
      req_param = {&quot;symbol&quot;: market, &quot;interval&quot;: interval, &quot;startTime&quot;: start_date, &quot;endTime&quot;: end_date, &quot;limit&quot;: limit}
  
      text = requests.get(url, params = req_param).text
      data = json.loads(text)
      df = pd.DataFrame(data)
      df.columns = ['open_time',
                      'o', 'h', 'l', 'c', 'v',
                      'close_time', 'qav', 'num_trades',
                      'taker_base_vol', 'taker_quote_vol', 'ignore']
  
      df.index = [dt.datetime.fromtimestamp(x/1000.0) for x in df.close_time]
  
      return df
  
  
  def chart(symbol, interval='1h'):
      windows = {'1m': 1, '5m': 5, '15m': 15, '30m': 30, '1h': 60, '2h': 120, '4h': 240, '6h': 360, '12h': 720, '1d': 1440}
      chart = get_candles(symbol.upper(), windows[interval], interval)
      fig = make_subplots(specs=[[{&quot;secondary_y&quot;: True}]])
      print(chart['v'].max())
      fig.add_trace(go.Candlestick(x=chart.index,
              open=chart['o'],
              high=chart['h'],
              low=chart['l'],
              close=chart['c'],
              name=&quot;yaxis1 data&quot;,
              yaxis='y1'), secondary_y=True)
      fig.add_trace(go.Bar(x=chart.index, y=chart['v'], name=&quot;yaxis2 data&quot;, yaxis=&quot;y2&quot;), secondary_y=False)
      fig.layout.yaxis2.showgrid=False
      fig.update_yaxes(type=&quot;linear&quot;)
      fig.update_layout(xaxis_rangeslider_visible=False)
      
      # fig.show()
  
      fig.write_image(&quot;figure.png&quot;, engine=&quot;kaleido&quot;)
      
  chart('bnb')
  </code></pre>
  <p>And it produces the following image:
  <a href="https://i.stack.imgur.com/yPpMr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yPpMr.png" alt="Chart this code generates" /></a></p>
  <p>Now I want it so that the volume bars go to only to 1/3 of the total height of the chart and I tried doing this like this:</p>
  <p><code>fig.update_layout(yaxis1=dict(title=&quot;bars&quot;, domain=[0, int(2* chart['v'].max())]))</code></p>
  <p>But this does nothing.</p>
  <p>How do I give a certain y-axis a name and change the range of that?</p>