Plotting#

Each function draws on a Matplotlib axes and returns it for further styling.

bindcurve.plot_fits(results, *, compounds=None, experiments=None, errorbars='sd', band=False, confidence=0.95, colors=None, ax=None)[source]#

Plot replicate means and the fitted curve of every experiment.

Parameters:
  • results (FitResults) – Fitted results; failed fits are skipped.

  • compounds (str | Iterable[str] | None) – Restrict the plot to these compounds and experiments.

  • experiments (str | Iterable[str] | None) – Restrict the plot to these compounds and experiments.

  • errorbars (Literal['sd', 'sem'] | None) – Spread of the technical replicates around each mean.

  • band (bool) – Draw a pointwise confidence band from each fit’s covariance.

  • confidence (float) – Confidence level of the band.

  • colors (object) – One color, or one color per fit. Defaults to the axes color cycle.

  • ax (Axes | None) – Axes to draw on; a new figure is created by default.

Raises:

ValueError – If band is true and a fit has no covariance.

Return type:

Axes

bindcurve.plot_compounds(results, *, compounds=None, errorbars='sd', colors=None, ax=None)[source]#

Plot one summary curve per compound.

Markers are grand means of the experiment means, so every experiment counts equally; error bars show their spread across experiments. The curve is the model at FitResults.parameters, i.e. at the reported summary values.

Parameters:
  • results (FitResults) – Fitted results.

  • compounds (str | Iterable[str] | None) – Restrict the plot to these compounds.

  • errorbars (Literal['sd', 'sem'] | None) – Spread of the experiment means around each grand mean.

  • colors (object) – One color, or one color per compound.

  • ax (Axes | None) – Axes to draw on; a new figure is created by default.

Return type:

Axes

bindcurve.plot_residuals(results, *, compounds=None, experiments=None, ax=None)[source]#

Plot observed minus fitted replicate means against concentration.

Parameters:
  • results (FitResults) – Fitted results; failed fits are skipped.

  • compounds (str | Iterable[str] | None) – Restrict the plot to these compounds and experiments.

  • experiments (str | Iterable[str] | None) – Restrict the plot to these compounds and experiments.

  • ax (Axes | None) – Axes to draw on; a new figure is created by default.

Return type:

Axes