plot-corr is a Python function to quickly calculate the r-squared and p-value of a correlation of two identical length variables. It also plots them with the regression line.
Make sure plot_corr.py is in the same directory as your analysis script.
from plot_corr import plot_corr
# Calling function
plot_corr(x,y)
See test.py for more details.