title: How to specify linear model when plotting in matplotlib
body: <p>I have a linear model of the form:</p>
  
  <p>Outcome ~ predictor_variable + group</p>
  
  <p>I would like to plot a representation of this, including confidence intervals.</p>
  
  <p>I am able to either plot the model correctly but cannot visualise the confidence intervals. Here I add some regression lines base on predicted values I get out of the fitted model:</p>
  
  <pre><code>fig, ax = plt.subplots() 
  sns.scatterplot(x='predictor', y='true_outcome', hue = 'group', data=df, ax=ax)
  sns.regplot(x='predictor,y='predicted_outcome',scatter=False, data = 
              df[df['group']==0], ax=ax)
  sns.regplot(x='predictor,y='predicted_outcome',scatter=False, data = 
              df[df['group']==1], ax=ax)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/oFvMN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oFvMN.png" alt="enter image description here"></a></p>
  
  <p>Or I can visualise confidence intervals but the plot does not accurately represent the model, as the two lines are fit independently:</p>
  
  <pre><code>sns.lmplot(x='predictor', y='true_outcome',  hue='group', data = df)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rYr03.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rYr03.png" alt="enter image description here"></a></p>
  
  <p>I would like some advice as to how to e.g. display appropriate confidence intervals on the first graph, or how to get lmplot to fit my desired model.</p>