outcome_plot_boxplot
Prettified boxplot of the outcome by treatment.
Features
- High-DPI figure, scalable fonts
- Soft modern color styling (default Matplotlib palette)
- Optional outliers, gentle transparency
- Optional save to PNG/SVG/PDF
Parameters
- data (
CausalData or MultiCausalData) – The causal dataset containing the dataframe and metadata. - treatment (
str) – Treatment column name. For MultiCausalData, if not provided, one-hot treatment columns are converted to assigned treatment labels. - outcome (
str) – Outcome column name. Defaults to the one indata_contracts. - figsize (
tuple) – Figure size in inches (width, height). - dpi (
int) – Dots per inch for the figure. - font_scale (
float) – Scaling factor for all font sizes in the plot. - showfliers (
bool) – Whether to show outliers (fliers). - patch_artist (
bool) – Whether to fill boxes with color. - palette (
list or dict) – Color palette for treatments (list in treatment order or dict {treatment: color}). - save (
str) – Path to save the figure (e.g., "boxplot.png"). - save_dpi (
int) – DPI for the saved figure. Defaults to 300 for raster formats. - transparent (
bool) – Whether to save the figure with a transparent background.
Returns
Figure– The generated figure object.