Skip to content

Stats lines

stats

Helper functions and classes for plotting stats information on an axes.

StatsLine

StatsLine(ax: Axes, y: float, x0: float, x1: float)

A horizontal statistical line with vertical drops at each end.

Parameters:

Name Type Description Default
ax Axes

Axes to draw the line on.

required
y float

y location of the line as a fraction of the axes height.

required
x0 float

x location of the start of the line in data coordinates.

required
x1 float

x location of the end of the line in data coordinates.

required

draw

draw() -> None

Draw/redraw the line on the axis.

set_transform

set_transform(x: str = 'data', y: str = 'axes') -> None

Set the transform for the stat bar.

Parameters:

Name Type Description Default
x (data, axes)

Coordinates x0 and x1 are given in. "data" is the data coordinates of the axis, "axes" is the proportion of the axis width.

"data"
y (data, axes)

Coordinates y is given in. "axes" is the proportion of the axis height, so resizing the axis does not change where the line sits relative to it.

"data"

Raises:

Type Description
ValueError

If x or y is not "data" or "axes".