plot_loci_curves#

demregpy.plotting.plot_loci_curves(
logt,
dn_in,
tresp,
*,
channels=None,
ax=None,
fig=None,
dem_space=True,
show_minimum=True,
minimum_kwargs=None,
xlabel='$\\log_{10} T$',
ylabel=None,
yscale='log',
ylim=None,
**kwargs,
)[source]#

Plot filter loci curves for a single observation vector.

By default the response matrix is scaled in the same bin-aware way used by dn2dem, so the loci curves can be overplotted directly on a DEM axis. Set dem_space=False to plot the raw DN / R(T) EM loci curves instead.

Parameters:
  • logt (array_like) – Temperature-bin centres in log10(T).

  • dn_in (array_like) – Input counts for one spectrum, with shape (nf,).

  • tresp (array_like) – Temperature response matrix with shape (nt, nf).

  • channels (sequence of str, optional) – Channel labels for the individual loci curves.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on.

  • fig (matplotlib.figure.Figure, optional) – Figure to draw on if ax is not given. If the figure already has an axes, it must have exactly one.

  • dem_space (bool, optional) – Apply the same bin-width scaling used by dn2dem so the curves are in DEM-like units and can be overplotted directly on a DEM axis.

  • show_minimum (bool, optional) – Plot the pointwise minimum loci envelope.

  • minimum_kwargs (dict, optional) – Keyword arguments passed to the minimum-envelope line.

  • xlabel (str, optional) – X-axis label.

  • ylabel (str, optional) – Y-axis label. If omitted, a default is chosen from dem_space.

  • yscale (str or None, optional) – Y-axis scale. Defaults to "log".

  • ylim (tuple[float, float], optional) – Explicit y limits. If omitted, robust limits are inferred from the loci envelope and any existing lines already on the axes.

  • **kwargs – Additional keyword arguments passed to Axes.plot for each loci curve.

Returns:

  • ax (matplotlib.axes.Axes) – Axes used for the plot.

  • lines (list[matplotlib.lines.Line2D]) – Line objects for the individual loci curves, followed by the minimum envelope if show_minimum=True.