2

I am wondering if plotly provides any way to to regression plots which show the scattering of the residues.

It should look similarly as if seaborn was used:

import seaborn as sns; sns.set_theme(color_codes=True)
tips = sns.load_dataset("tips")
ax = sns.regplot(x="total_bill", y="tip", data=tips)
Derek O
  • 16,770
  • 4
  • 24
  • 43
NND
  • 23
  • 4
  • I answered a similar question [here](https://stackoverflow.com/questions/71211139/how-to-add-confidence-interval-fillcontour-using-plotly-express/71214795#71214795). you can create a `regplot` in seaborn and extract the array representing the upper and lower array and fill the area in between. if you like, i would be happy to circle back and provide an answer when i have a moment later – Derek O Mar 09 '22 at 05:36

1 Answers1

1

try this: use trendline parameters for similar expression as sns regplot.

import plotly.express as px
fig = px.scatter(tips,x = 'total_bill',y= 'tip', trendline='ols',trendline_color_override='red')
micro5
  • 415
  • 3
  • 6