plot_cox_forest

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

plot_cox_forest(names: Sequence[str], hazard_ratio: ndarray, lower: ndarray, upper: ndarray, *, p_values: ndarray | None = None, title: str = 'Hazard ratios')[source]

Forest plot of hazard ratios with 95% confidence intervals (log scale).

Parameters:
  • names – Covariate names (sanitised).

  • hazard_ratio – Point estimate of each hazard ratio.

  • lower – Lower confidence bound per covariate.

  • upper – Upper confidence bound per covariate.

  • p_values – Optional per-covariate p-value, annotated alongside.

  • title – Figure title (sanitised).

Returns:

The matplotlib Figure.