Plotting Package#

Most users should call plotting methods on a fitted jaxqsofit.JAXQSOFit object, especially jaxqsofit.JAXQSOFit.plot_spectrum(), jaxqsofit.JAXQSOFit.plot_corner(), and jaxqsofit.JAXQSOFit.plot_trace().

jaxqsofit.plotting.plot_spectrum(fitter, **kwargs)[source]#

Plot the fitted spectrum, model components, and residuals.

This is the preferred public plotting method. It delegates to plot_fig(), which remains available for compatibility with older notebooks.

jaxqsofit.plotting.plot_fig(fitter, save_fig_path=None, broad_fwhm=1200, plot_legend=True, ylims=None, plot_residual=True, show_title=True, plot_1sigma=True, sigma_alpha=0.12, show_plot=True, plot_psf_space=False, plot_intrinsic_powerlaw=False)[source]#

Plot data, model components, line decomposition, and residuals.

Parameters:
  • save_fig_path (str or None, optional) – Output directory when saving figures. If None, uses fitter.output_path (or '.' when unset).

  • broad_fwhm (float, optional) – Reserved broad-line threshold (kept for compatibility).

  • plot_legend (bool, optional) – If True, draw a legend.

  • ylims (tuple[float, float] or None, optional) – Optional y-axis limits for the spectrum panel.

  • plot_residual (bool, optional) – If True, draw residual panel below the spectrum.

  • show_title (bool, optional) – Reserved title toggle kept for compatibility.

  • plot_1sigma (bool, optional) – If True, draw 16-84% posterior bands for available components.

  • sigma_alpha (float, optional) – Alpha transparency of 1-sigma bands.

  • show_plot (bool, optional) – If True, call plt.show(). If False, figure is created/saved without display.

  • plot_psf_space (bool, optional) – If True, plot the PSF-space model/components. In this mode the residual panel is suppressed because the observed spectrum remains on the fiber scale.

  • plot_intrinsic_powerlaw (bool, optional) – If True, overlay the intrinsic AGN power law before multiplicative polynomial tilt and additive edge corrections.

jaxqsofit.plotting.plot_trace(fitter, param_names=None, max_vector_elems=2, save_fig_path=None, save_fig_name=None, show_plot=False)[source]#

Plot posterior trace series for selected parameters.

Parameters:
  • param_names (list[str] | str | None, optional) – Parameter selector. Use 'all' to include all posterior keys.

  • max_vector_elems (int or None, optional) – Maximum number of vector elements to expand per key.

  • save_fig_path (str or None, optional) – Output directory when saving figures. If None, uses fitter.output_path (or '.' when unset).

  • save_fig_name (str or None, optional) – Output filename override.

  • show_plot (bool, optional) – If True, display the figure interactively with plt.show(). Defaults to False so diagnostics are safe to call in headless terminals.

jaxqsofit.plotting.plot_corner(fitter, param_names=None, max_vector_elems=2, bins=30, max_points=5000, save_fig_path=None, save_fig_name=None, show_plot=False)[source]#

Plot posterior projections with corner.corner.

Parameters:
  • param_names (list[str] | str | None, optional) – Parameter selector. Use 'all' to include all posterior keys.

  • max_vector_elems (int or None, optional) – Maximum number of vector elements to expand per key.

  • bins (int, optional) – Histogram bin count.

  • max_points (int, optional) – Maximum posterior draws to plot (subsampled if needed).

  • save_fig_path (str or None, optional) – Output directory when saving figures. If None, uses fitter.output_path (or '.' when unset).

  • save_fig_name (str or None, optional) – Output filename override.

  • show_plot (bool, optional) – If True, display the figure interactively with plt.show(). Defaults to False so diagnostics are safe to call in headless terminals.

jaxqsofit.plotting.plot_mcmc_diagnostics(fitter, do_trace=True, do_corner=True, param_names=None, max_vector_elems=2, corner_bins=30, corner_max_points=2000, save_fig_path=None, show_plot=False)[source]#

Plot trace and/or corner diagnostics in a single convenience call.

Parameters:
  • do_trace (bool, optional) – If True, render trace plot.

  • do_corner (bool, optional) – If True, render corner plot.

  • param_names (list[str] | str | None) – Parameter selector shared by both trace and corner plots. Use 'all' to include all posterior parameters.

  • max_vector_elems (int or None, optional) – Maximum number of vector elements to expand per key.

  • corner_bins (int, optional) – Histogram bin count for corner plot.

  • corner_max_points (int, optional) – Maximum posterior draws to use in corner plot.

  • save_fig_path (str or None, optional) – Output directory when saving figures. If None, uses fitter.output_path (or '.' when unset).

  • show_plot (bool, optional) – If True, display each enabled diagnostics figure interactively with plt.show(). Defaults to False so diagnostics are safe to call in headless terminals.

jaxqsofit.plotting.posterior_series(fitter, param_names=None, max_vector_elems=2)[source]#

Flatten posterior samples into labeled 1D series for diagnostics.

Parameters:
  • param_names (list[str] | str | None, optional) – Parameter selector. Use 'all' for all posterior keys.

  • max_vector_elems (int or None, optional) – Maximum number of vector elements to expand per key.

jaxqsofit.plotting.observed_photometry_for_plot(fitter)[source]#

Return rest-frame observed PSF photometry points for plotting, if available.

jaxqsofit.plotting.synthetic_photometry_for_plot(fitter, model_attr='model_total')[source]#

Return rest-frame synthetic photometry points for plotting, if available.

jaxqsofit.mplstyle.style_path()[source]#

Return the packaged Matplotlib style file path.

Return type:

str

jaxqsofit.mplstyle.use_style()[source]#

Apply the packaged Matplotlib style within a context manager.