drippy.comparative

Plotting functions for comparative and multivariate models.

Attributes

_MARKERS

Functions

block_plot(→ tuple[matplotlib.figure.Figure, ...)

Creates a block plot of y vs treatment, grouped by block.

youden_plot(→ tuple[matplotlib.figure.Figure, ...)

Creates a Youden plot comparing two labs or measurement methods.

star_plot(→ tuple[matplotlib.figure.Figure, ...)

Creates a star (radar) plot of multivariate data.

Module Contents

drippy.comparative._MARKERS = ['o', 's', '^', 'D', 'v', 'P', '*', 'X'][source]
drippy.comparative.block_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 block plot of y vs treatment, grouped by block.

Shows treatment effects within each block as connected line segments, one series per block level.

Parameters:
  • data – EDAData container. Requires factors with keys "treatment" and "block".

  • fig – Matplotlib figure. If None, creates new figure.

  • ax – Matplotlib axes. If None, creates new axes.

Returns:

The figure and axes containing the plot.

Raises:

ValueError – If factors is None or missing required keys.

drippy.comparative.youden_plot(data: drippy.data.EDAData, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None, doe: bool = False) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]

Creates a Youden plot comparing two labs or measurement methods.

Plots Lab 1 (y) vs Lab 2 (x) with an equality line and median reference lines to reveal bias and lab effects.

Parameters:
  • data – EDAData container. Requires x (Lab 2 measurements) and y (Lab 1 measurements).

  • fig – Matplotlib figure. If None, creates new figure.

  • ax – Matplotlib axes. If None, creates new axes.

  • doe – If True, overlays DOE design point markers.

Returns:

The figure and axes containing the plot.

Raises:

ValueError – If x is None.

drippy.comparative.star_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 star (radar) plot of multivariate data.

Each observation is drawn as a polygon on a polar axis, with one spoke per variable. Values are normalized 0-1 per variable.

Parameters:
  • data – EDAData container. Requires factors for additional variables beyond y.

  • fig – Matplotlib figure. If None, creates new polar figure.

  • ax – Matplotlib axes (polar). If None, creates new polar axes.

Returns:

The figure and axes containing the plot.

Raises:

ValueError – If factors is None.