title: plotly with multiple series
body: <p>I want to replicate this graph below. I have reached a stage where I could reproduce the bar chart in R, using plot_ly. But, I rather failed to add the line segment in the secondary axis. So, can someone help me what I should add in my chart code, to get a similar axis. I have the details and a MWE below. </p>
  
  <p><a href="https://i.stack.imgur.com/vK6ol.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vK6ol.png" alt="enter image description here"></a></p>
  
  <p>I am trying to use plot_ly. Here is my dataframe and what I did: </p>
  
  <pre><code># download data  
  if (!file.exists("SCFP2013.xlsx")) {
    download.file("https://www.federalreserve.gov/econres/files/scfp2013excel.zip", "SCFP2013.zip")
    unzip("scfp2013.zip")
  } 
  
  df &lt;- read_excel("SCFP2013.xlsx")
  df[df$NETWORTH &lt; 0, ]$NETWORTH &lt;- 0 # if net worth is less than 0, assign a value of zero
  
  # compute values of retirmet assets 
  households2 &lt;- data.frame(
    netWorth = df$NETWORTH,
    weight = df$WGT,
    RETQLIQ = df$RETQLIQ    
  )
  
  # group households into segments
  households2 &lt;- households2[households2$netWorth &gt;= 10000, ]
  
  # split into net worth segments 
  nw2 &lt;- floor(log10(households2$netWorth))
  segment2 &lt;- ifelse(nw2 == 4, "     $10k", 
                     ifelse(nw2 == 5, "    $100K", 
                            ifelse(nw2 == 6, "   $1M",               
                                   ifelse(nw2 == 7, "  $10M",               
                                          ifelse(nw2 == 8, " $100M",               
                                                 "$1B+"))))) 
  
  # compute average asset distrubtions
  results2            &lt;- as.data.frame((aggregate(households2,list(segment2),mean)))
  results2$life.cycle &lt;- results2$RETQLIQ/results2$netWorth
  
  plot_ly(results2, x = ~Group.1, y = ~RETQLIQ, type = 'bar', name = 'Retirement (Pension/IRA)') %&gt;%
    layout(yaxis = list(title = 'Millions'), xaxis = list(title = "Net Worth"),
           title = "Pensions Wealth", barmode = 'stack')
  </code></pre>