drippy.onefactor
Plotting functions for 1-factor models (y = f(x) + e, x categorical).
Attributes
Functions
|
Creates a scatter plot of y vs x. |
|
Creates a box plot of y grouped by factor levels in x. |
|
Creates side-by-side histograms for exactly 2 factor levels. |
|
Creates a quantile-quantile plot comparing 2 factor level distributions. |
|
Creates a mean plot of y grouped by factor levels in x. |
|
Creates a standard deviation plot of y grouped by factor levels in x. |
Module Contents
- drippy.onefactor.scatter_plot(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]
Creates a scatter plot of y vs x.
Also used in regression context (see drippy.regression).
- Parameters:
data – EDAData container. Requires x.
fig – Matplotlib figure. If None, creates new figure.
ax – Matplotlib axes. If None, creates new axes.
- Returns:
The figure and axes containing the plot.
- drippy.onefactor.box_plot(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]
Creates a box plot of y grouped by factor levels in x.
- Parameters:
data – EDAData container. Requires x (categorical).
fig – Matplotlib figure. If None, creates new figure.
ax – Matplotlib axes. If None, creates new axes.
- Returns:
The figure and axes containing the plot.
- drippy.onefactor.bihistogram(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, axes: numpy.ndarray | None = None, bins: int | str = 'auto') tuple[matplotlib.figure.Figure, numpy.ndarray][source]
Creates side-by-side histograms for exactly 2 factor levels.
- Parameters:
data – EDAData container. Requires x with exactly 2 unique levels.
fig – Matplotlib figure. If None, creates new figure.
axes – Array of 2 Axes. If None, creates new axes.
bins – Number of bins or bin strategy.
- Returns:
(fig, axes) where axes is a 1-D array of 2 Axes.
- drippy.onefactor.qq_plot(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]
Creates a quantile-quantile plot comparing 2 factor level distributions.
- Parameters:
data – EDAData container. Requires x with exactly 2 unique levels.
fig – Matplotlib figure. If None, creates new figure.
ax – Matplotlib axes. If None, creates new axes.
- Returns:
The figure and axes containing the plot.
- drippy.onefactor.mean_plot(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]
Creates a mean plot of y grouped by factor levels in x.
Shows group means connected by a line, with a horizontal grand mean.
- Parameters:
data – EDAData container. Requires x.
fig – Matplotlib figure. If None, creates new figure.
ax – Matplotlib axes. If None, creates new axes.
- Returns:
The figure and axes containing the plot.
- drippy.onefactor.sd_plot(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]
Creates a standard deviation plot of y grouped by factor levels in x.
Shows group standard deviations connected by a line, with a horizontal overall standard deviation reference line.
- Parameters:
data – EDAData container. Requires x.
fig – Matplotlib figure. If None, creates new figure.
ax – Matplotlib axes. If None, creates new axes.
- Returns:
The figure and axes containing the plot.