Let's get started by importing Matplotlib and Numpy
Now let's create a reproducible random number generator. This ensures the result is the same no matter how many times we generate the random data.
And finally, let's generate some random data, make the scatterplot, and add the regression line:
Going further
This post explains how to add a simple linear regression fit in a scatter plot.
You might be interested by how to add estimated coefficients on the plot and how to display regression fit with seaborn.