jade.basic.plotting.correlations.annotate_r_value(data, x, y, ax, func=<function pearsonr>, template=None, stat=None, loc='best')[source]

Forked from seaborn JointPlot for use with regplot, scatter, etc. Woot. Needs to actually go into Seaborn Now!

Annotate the plot with a statistic about the relationship.

data: pandas.DataFrame x: str y: str ax: matplotlib.Axes

func : callable
Statistical function that maps the x, y vectors either to (val, p) or to val.
template : string format template, optional
The template must have the format keys “stat” and “val”; if func returns a p value, it should also have the key “p”.
stat : string, optional
Name to use for the statistic in the annotation, by default it uses the name of func.
loc : string or int, optional
Matplotlib legend location code; used to place the annotation.