arista.viz.sigmoid_fits

Sigmoid-fit overlay of the response curves.

One panel per cell type. Within each panel: a light scatter of every (Δtarget, ΔF/F) point in the response frame, overlaid with one fitted 4PL sigmoid per strain. Per-strain colours come from arista.constants.STRAIN_COLOURS so the same strain reads the same across response_curves / gain_comparison / sigmoid_fits panels.

For groups too sparse / flat to fit, the scatter still appears but no curve is drawn — failure is silent, not an exception, so the figure still renders for the full corpus.

Functions

plot_sigmoid_fits(data, *[, stimulus_name, ...])

One panel per cell type; one fitted sigmoid per strain.

Classes

SigmoidFits([cell_types, figsize, dpi, ...])

Callable wrapper holding default styling.

class arista.viz.sigmoid_fits.SigmoidFits(cell_types=('CC', 'HC'), figsize=(10, 5), dpi=200, strains=None, n_curve=200, scatter_alpha=0.18, scatter_size=8.0)[source]

Bases: object

Callable wrapper holding default styling.

Mirrors arista.viz.response_curves.ResponseCurves.

Parameters:
cell_types: tuple[str, ...] = ('CC', 'HC')
dpi: int = 200
figsize: tuple[float, float] = (10, 5)
n_curve: int = 200
plot(data, *, stimulus_name=None, title=None, **overrides)[source]
Parameters:
Return type:

Figure

save(fig, path, *, dpi=None, close=True)[source]

Save fig as PNG. SVG sibling is written automatically.

Parameters:
  • fig (Figure)

  • path (Path | str)

  • dpi (int | None)

  • close (bool)

Return type:

Path

scatter_alpha: float = 0.18
scatter_size: float = 8.0
strains: tuple[str, ...] | None = None
arista.viz.sigmoid_fits.plot_sigmoid_fits(data, *, stimulus_name=None, cell_types=('CC', 'HC'), strains=None, figsize=(10, 5), title=None, n_curve=200, scatter_alpha=0.18, scatter_size=8.0)[source]

One panel per cell type; one fitted sigmoid per strain.

Parameters:
  • data (pd.DataFrame | sqlite3.Connection) – Either an already-fetched response frame (output of fetch_response_data()) or a live SQLite connection.

  • stimulus_name (str | None) – Mandatory when data is a connection.

  • cell_types (tuple[str, ...]) – Cell types to plot, one panel per.

  • strains (tuple[str, ...] | None) – Optional strain whitelist.

  • figsize (tuple[float, float]) – (width, height) inches.

  • title (str | None) – Optional figure suptitle (auto from stimulus_name).

  • n_curve (int) – Number of x-samples in each plotted sigmoid line.

  • scatter_alpha (float) – Per-point alpha for the underlying scatter.

  • scatter_size (float) – Per-point marker area for the scatter.

Returns:

matplotlib.figure.Figure. Caller owns I/O.

Return type:

Figure