plot_top_n_solution_equity
site.SiteSolutionSet.plot_top_n_solution_equity(
n=4,
rank_on=None,
show_average=True,
plot_solution_metric_as_line='weighted_average',
colour_mode=None,
cols=2,
figsize_multiplier=5,
)Plot equity summaries for the top N solutions in a grid of subplots.
This method generates a series of bar plots showing the distribution of mean minimum cost (min_cost) across equity groups for the top-ranked solutions. It reuses check_solution_equity to ensure consistent computation and styling.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n | int | Number of top-ranked solutions to plot. | 4 |
| rank_on | str or None | Column name used to rank solutions before selecting the top n. If None, the existing order is used. |
None |
| show_average | bool | If True, display the overall average of min_cost as a horizontal dotted line on each subplot. |
True |
| cols | int | Number of subplot columns. The number of rows is determined automatically. | 2 |
Returns
| Name | Type | Description |
|---|---|---|
| matplotlib.figure.Figure | A Matplotlib figure containing the grid of subplots. |
Notes
- Subplots are arranged row-wise based on the specified number of columns.
- Any unused subplot axes are removed if
ndoes not fill the grid. - All plots are generated using the non-interactive (Matplotlib) mode of
check_solution_equity. - Each subplot corresponds to a solution ranked from 1 to
n.