title: Plotly: How to plot a bar & line chart combined with a bar chart as subplots?
body: <p>I am trying to plot two different charts in python through plotly. I have two plots, one plot consists of merged graph ( line and bar chart) like the following,</p>
  
  <p><a href="https://i.stack.imgur.com/4N1Nt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4N1Nt.png" alt="Line_Bar_Chart"></a>, </p>
  
  <p>and another one is bar chart as follows,</p>
  
  <p><a href="https://i.stack.imgur.com/fQ3yR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fQ3yR.png" alt="Bar Chart"></a></p>
  
  <p>I wanted to display one single chart with these two combined charts and display the same. I have tried this in <strong>plotly</strong> through <strong>make_subplots</strong> but I am not able to achieve the results properly. Below are the codes for creating these two charts,</p>
  
  <p><strong>Line_Bar_chart Code</strong>:</p>
  
  <pre><code>import plotly.graph_objects as go
  from plotly.offline import iplot
  
  trace1  = go.Scatter(
          mode='lines+markers',
          x = df['Days'],
          y = df['Perc_Cases'],
          name="Percentage Cases",
          marker_color='crimson'
      )
  
  trace2 = go.Bar(
          x = df['Days'],
          y = df['Count_Cases'],
          name="Absolute_cases",
          yaxis='y2',
          marker_color ='green',
          marker_line_width=1.5,
          marker_line_color='rgb(8,48,107)',
          opacity=0.5
      )
  
  data = [trace1, trace2]
  
  layout = go.Layout(
      title_text='States_Name',
      yaxis=dict(
          range = [0, 100],
          side = 'right'
      ),
      yaxis2=dict(
          overlaying='y',
          anchor='y3',
      )
  )
  fig = go.Figure(data=data, layout=layout)
  iplot(fig, filename='multiple-axes-double')
  **Line_Bar_chart Code**:
  </code></pre>
  
  <p><strong>Bar_chart Code</strong>:</p>
  
  <pre><code>trace2 = go.Bar(
          x = df['Days'],
          y = df['Perc_Cases'],
          yaxis='y2',
          marker_color ='green',
          marker_line_width=1.5,
          marker_line_color='rgb(8,48,107)',
          opacity=0.5,
      )
  layout = go.Layout(
      title_text='States_Name',
      yaxis2=dict(
          overlaying='y',
  
      )
  )
  fig = go.Figure(data=trace2, layout=layout)
  iplot(fig, filename='multiple-axes-double')
  </code></pre>
  
  <p>Any help on how to make subplots of these two graphs like below would be helpful,
  <a href="https://i.stack.imgur.com/cHvGy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cHvGy.png" alt="enter image description here"></a></p>