Home > Back-end >  How to plot lines between datapoints and the Line of best fit?
How to plot lines between datapoints and the Line of best fit?

Time:04-09

I want to plot the lines between the data points on my linear regression and the line of best fit. Looking to create the grey lines in the attached image.

Image attached here

CodePudding user response:

Here is a minimal working example.

In summary, the points are a scatter, the fit line is computed with scatter with fit line and vertical lines

  • Related