Stats#
Statistical overlay configuration classes and their factory functions.
Factory functions#
- gufo.regression(degree=1, *, color=None, linestyle='-', linewidth=2.0, label=None, n_points=200)[source]#
Create a regression fit configuration for scatter plots.
Config classes#
- class gufo.stats.regression.Regression(degree=1, color=None, linestyle='-', linewidth=2.0, label=None, n_points=200)[source]#
Bases:
objectConfiguration for a regression fit line overlaid on a scatter plot.
Users create instances via gufo.regression(), never directly.
- Parameters:
- class gufo.stats.kde.KDE(bw_method=None, color=None, linestyle='-', linewidth=2.0, alpha=1.0, label=None, fill=False, n_points=200)[source]#
Bases:
objectConfiguration for a KDE curve.
Used as an overlay on .histogram() via histogram(kde=gufo.kde(…)). For a standalone density plot, use Chart.kdeplot() instead.
Users create instances via gufo.kde(), never directly.
- Parameters:
- render(x, axes, *, scale_to_hist=False, hist_patches=None, **extra_kwargs)[source]#
Compute and draw the KDE curve.
Parameters#
- xnumpy array
The data to estimate density for.
- axesmatplotlib Axes
Target axes to draw on.
- scale_to_histbool
If True, scale the KDE to match histogram bar heights.
- hist_patcheslist or None
Patches from axes.hist(), used for bin width when scaling.
- **extra_kwargs
Additional keyword arguments passed through to matplotlib.
- class gufo.stats.lowess.Lowess(frac=0.6667, color=None, linestyle='-', linewidth=2.0, label=None)[source]#
Bases:
objectConfiguration for a LOWESS smoothing curve overlaid on a scatter plot.
Users create instances via gufo.lowess(), never directly.