title: Plotly line chart with confidence interval using groupby
body: <p>I'd like to plot time series simulation data as a mean with confidence intervals and compare multiple scenarios.
  Using the pandas <code>groupby()</code> and <code>agg()</code> functions a calculate the mean and confidence interval (upper and lower limit) <a href="https://i.stack.imgur.com/ZSi3G.png" rel="nofollow noreferrer">see sample data</a> (the actual data can be retrieved from <a href="https://github.com/thefeinkoster/plotly_issue" rel="nofollow noreferrer">my github</a>.</p>
  <p><strong>Edit:</strong> I added the raw data to the and the code (as a jupyter notebook) to the <a href="https://github.com/thefeinkoster/plotly_issue" rel="nofollow noreferrer">git</a></p>
  <p>Plotting this data for one specific parameter combination (selecting data via <code>df = df.loc[(slice(None),1, True)]</code>) seams simple enough:</p>
  <pre><code>myFig = go.Figure([
  go.Scatter(
      name='Mittelwert',
      #x=df['tick'],
      y=df['mean'],
      mode='lines',
      line=dict(color='rgb(31, 119, 255)'),
  ),
  go.Scatter(
      name='Konfidenzintervall',
      #x=df['tick'],
      y=df['ci95_hi'],
      mode='lines',
      marker=dict(color=&quot;#644&quot;),
      line=dict(width=0),
      showlegend=True
  ),
  go.Scatter(
      name='Konfidenzintervall',
      #x=df['tick'],
      y=df['ci95_lo'],
      marker=dict(color=&quot;#448&quot;),
      line=dict(width=0),
      mode='lines',
      fillcolor='rgba(130, 68, 68, 0.5)',
      fill='tonexty',
      showlegend=True
  )
  ])
  myFig.update_layout(
      xaxis_title='X Achse',
      yaxis_title='Y Achse',
      title='Continuous, variable value error bars',
      hovermode=&quot;x&quot;
      )
  myFig.show()
  </code></pre>
  <p>This code gives me the <a href="https://i.stack.imgur.com/hxeFp.png" rel="nofollow noreferrer">that</a> beautiful plot. The issue is a do not know how to properly plot the grouped data. When I don't select a subset all data is plotted at once.
  Therefore i tried to use <code>color</code>, <code>facet_col</code> and <code>facet_row</code> which I could get working using</p>
  <pre><code>px.line(reset_df, x = &quot;tick&quot;, y=&quot;mean&quot;, color=&quot;first_factor&quot;,facet_col=&quot;second_factor&quot;)
  </code></pre>
  <p>(Since plotly apparently can't handle MultiIndex Dataframe i used <code>reset_index()</code> to get a DataFrame with a 'RangeIndex' first). The issue is with the latter approach I'm now missing the confidence interval and don't know how to add it (<a href="https://i.stack.imgur.com/MScn2.png" rel="nofollow noreferrer">c.f. this plot</a>).</p>
  <p>How can I have both the ci and the grouped data within one plot? If this is not possible with pandas is it with bokeh?
  Thank you very much</p>