uvex_transients.utils.plotting.plot_histogram#
- uvex_transients.utils.plotting.plot_histogram(values: NDArray, *, title: str | None = None, xlabel: str | None = None, ylabel: str = 'Pixels', n_bins: int = 50, color: str | None = None, fig: Figure | None = None, ax: Axes | None = None, fig_size: tuple = (9, 5.5)) tuple[Figure, Axes][source]#
Log-binned histogram of a strictly positive quantity, e.g. one pooled across a HEALPix map’s pixels.
- Parameters:
values (
array-like) – Values to histogram. Non-positive and non-finite entries are dropped before binning.title (
str, optional) – Axes title.xlabel (
str, optional) – X-axis label.ylabel (
str, optional) – Y-axis label. The default,"Pixels", suits a per-pixel diagnostic; pass e.g."Pairs of visits"for a per-pair one.n_bins (
int, optional) – Number of log-spaced bins between values’ min and max. The default is50.color (
str, optional) – Bar color. Defaults to a fixed point on get_default_cmap, so histograms across a page share one consistent color drawn from the same palette as any accompanying plot_healpix_map calls.fig (
matplotlib.figure.Figure,matplotlib.axes.Axes, optional) – Existing figure/axes to draw onto, via resolve_fig_axes.ax (
matplotlib.figure.Figure,matplotlib.axes.Axes, optional) – Existing figure/axes to draw onto, via resolve_fig_axes.fig_size (
tuple, optional) – Passed to resolve_fig_axes when creating a new figure.
- Returns:
fig (
matplotlib.figure.Figure) – The resolved figure.ax (
matplotlib.axes.Axes) – The axes the histogram was drawn onto.