title: How to overlay two plots in same figure in plotly ( Create Pareto chart in plotly )?
body: <p>I was trying to plot barplot and scatterplot in the same plot in plotly, but it shows only scatterplot.</p>
  
  <p>How to show both the plots?</p>
  
  <h1>data</h1>
  
  <pre><code>import numpy as np
  import pandas as pd
  import seaborn as sns
  import matplotlib.pyplot as plt
  from matplotlib.ticker import PercentFormatter
  
  import plotly
  import plotly.offline as py
  import plotly.graph_objs as go
  import plotly.figure_factory as ff
  import plotly.tools as tls
  from plotly.subplots import make_subplots
  from plotly.offline import plot, iplot, init_notebook_mode
  init_notebook_mode(connected=False)
  
  df = pd.DataFrame({
              'price': [ 4.0, 17.0, 7.0, 7.0, 2.0, 1.0, 1.0],
              'item': ['apple', 'banana', 'carrot', 'plum',
                      'orange', 'date', 'cherry']})
  
  df = df.sort_values(num,ascending=False)
  df['cumulative_sum'] = df[num].cumsum()
  df['cumulative_perc'] = 100*df['cumulative_sum']/df[num].sum()
  
  df['demarcation'] = 80
  
  
  num = 'price'
  cat = 'item'
  title = 'Pareto Chart'
  </code></pre>
  
  <h1>Code</h1>
  
  <pre><code>trace1 = go.Bar(
      x=df[cat],
      y=df[num],
      name=num,
      marker=dict(
          color='rgb(34,163,192)'
                 )
  )
  trace2 = go.Scatter(
      x=df[cat],
      y=df['cumulative_perc'],
      name='Cumulative Percentage',
      yaxis='y2',
  
  )
  
  data = [trace1,trace2]
  
  fig = dict(data=data)
  iplot(fig)
  </code></pre>
  
  <h1>Output</h1>
  
  <p><a href="https://i.stack.imgur.com/oYydO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oYydO.png" alt="enter image description here"></a></p>
  
  <h1>Required</h1>
  
  <ul>
  <li>show both barchart and scatterplot</li>
  <li>barchart y-ticks on left y-axis</li>
  <li>scatterplot y-ticks on right y-axis</li>
  <li>xticklabels rotate 90 degree</li>
  </ul>