Plotting#

Plot observations, fitted curves, residuals, compound summaries, asymptotes, and evaluated points with Matplotlib.

CurvePoint#

class bindcurve.CurvePoint[source]#

Bases: object

Point to annotate on a fitted curve.

__init__(x, label=None)#
Parameters:
Return type:

None

plot_fits#

bindcurve.plot_fits(data, results, *, compounds=None, ax=None, experiments=None, show_markers=True, marker_kind='o', marker_size=5.0, show_curves=True, curve_width=1.0, curve_style='-', show_errorbars=True, errorbar_kind='sd', errorbar_linewidth=1.0, errorbar_capsize=3.0, colors=None, x_grid=None, n_points=300, xscale='log', confidence_band=False, confidence_level=0.95, confidence_band_kwargs=None)[source]#

Plot observations and fitted curves for each independent experiment.

Optional confidence bands are covariance-based pointwise confidence bands around the fitted mean curve for each experiment-level fit.

Parameters:
Return type:

Axes

plot_compounds#

bindcurve.plot_compounds(data, results, *, compounds=None, ax=None, show_markers=True, marker_kind='o', marker_size=5.0, show_curves=True, curve_width=1.0, curve_style='-', dose_representation='mean', show_errorbars=True, errorbar_kind='sd', errorbar_linewidth=1.0, errorbar_capsize=3.0, colors=None, x_grid=None, n_points=300, xscale='log')[source]#

Plot one summary dose-response curve per compound.

A plotted series is one compound. Markers and fitted curve share one label and one base color by default. The curve is the pointwise arithmetic mean of the successful experiment-level fitted predictions; failed fits are excluded. Plotting never fits or modifies data. Grand-mean or experiment-level observations are selected with dose_representation.

Parameters:
Return type:

Axes

plot_residuals#

bindcurve.plot_residuals(data, results, *, compound_id=None, ax=None, experiments=None, aggregate=True, standardized=False, xscale='log', zero_line=True, label=None, zero_line_kwargs=None, **scatter_kwargs)[source]#

Plot fit residuals against concentration on an existing axes.

Residuals are computed as observed - predicted. Set standardized to divide them by known observation sigma. By default, technical replicates are aggregated in the same way as fitted observations.

Parameters:
Return type:

Axes

plot_asymptotes#

bindcurve.plot_asymptotes(data, results, *, compound_id=None, ax=None, experiments=None, parameters=('ymin', 'ymax'), label=True, **line_kwargs)[source]#

Plot model asymptotes as horizontal lines on an existing axes.

Parameters:
Return type:

Axes

plot_curve_points#

bindcurve.plot_curve_points(data, results, *, points, compound_id=None, ax=None, experiments=None, annotate=True, annotation_offset=(6.0, 6.0), point_kwargs=None, annotation_kwargs=None)[source]#

Plot arbitrary labeled points evaluated on fitted curves.

Parameters:
Return type:

Axes