plot_pareto_summary
site.SiteSolutionSet.plot_pareto_summary(
id_col='solution_rank',
name_col=None,
diff_against=None,
height=5,
width_multiplier=2,
theme='whitegrid',
other_color='lightgray',
palette='tab10',
show_value_labels=True,
title=None,
caption=None,
ax=None,
interactive=False,
initially_shown='all',
legend_wrap_at=None,
scale_to='all',
)Plot every solution as a line across all metrics at once, each axis independently rescaled so “up” always means “better” regardless of whether the underlying metric is minimised, maximised, or has a target value.
This is the genuinely multi-objective counterpart to a grid of pairwise 2D Pareto plots. A pairwise grid can be misleading once you have 3+ objectives: a solution can look non-dominated in every single 2D projection shown, while still being dominated once all metrics are considered together (because the dominating solution’s advantage sits on a third axis that isn’t in that particular pair). Equally, a solution can look beaten in one 2D pair by something that is actually worse overall once every metric is weighed in. A parallel coordinates plot avoids both failure modes because every axis is shown simultaneously on every line.
Pareto-optimal solutions (is_pareto_optimal == True, as produced by pareto.compute_pareto_front) are drawn in colour and labelled; dominated solutions are drawn as thin grey background lines, so the front stands out against the full brute-forced solution space.
palette: any matplotlib/seaborn colormap name. Qualitative palettes (tab10, Set2, …) look cleanest for small fronts; if the number of Pareto-optimal options exceeds the palette’s distinct colours, colours are cycled and combined with a different linestyle/marker per cycle so lines stay distinguishable. Continuous palettes (e.g. “husl”, “viridis”) sidestep this by generating a fresh colour per line regardless of how many there are. show_value_labels: if True (default), annotate each point on a closest_to_target axis with its signed distance from target (e.g. “+0.09”). Turn off for a cleaner chart once you’ve got more than a handful of options and the labels start to crowd. diff_against: str or None, default None If given, appends a compact “+added, -removed” site-name diff to each Pareto-optimal line’s legend label – the same per-row diff show_solutions_summary(diff_against=...) computes, see _resolve_site_diff for the exact values accepted (“default”, “rank_1”, “previous_rank”, “required_sites”) and what each one means. None (the default) leaves labels as name_col/id_col only, matching prior behaviour. Since this is computed over just the Pareto-optimal front rows, “previous_rank” diffs each option against the next-best Pareto-optimal option, not against a dominated solution that happens to sit between them in rank. title / caption: shown above/below the chart. Sensible stakeholder- facing defaults are used if not provided; pass “” to suppress either entirely. interactive: bool, default False If True, returns an interactive Plotly figure. Hover a point on an option’s line for its raw value, its rank and the sites that make up that option, or anywhere along the line for the option and its sites; click a legend entry to hide that option, or double-click one to show it alone. height, width_multiplier, theme, show_value_labels and ax are ignored (the hover shows how far a target metric is from its target instead). initially_shown: “all”, “first” or list of ids, default “all” Which options are visible when an interactive figure first opens. The rest start greyed out in the legend, one click from being shown. “all” shows every option, “first” only the first option in the legend, and a list, tuple or set picks specific options by their id_col value (e.g. [1, 17]), even when name_col is set. Ignored if interactive=False, though an invalid value still raises. legend_wrap_at: int, optional Wrap legend labels onto multiple lines at this many characters; None (the default) leaves them on one line. Worth setting when diff_against makes labels long. Only the legend wraps: the interactive hover title keeps the full label on one line. scale_to: {“all”, “pareto_front”}, default “all” Which options each axis’s best and worst values are taken from. “all” scales over every option compared, dominated ones included, so the chart shows how good the front is against everything that was evaluated. “pareto_front” scales over just the Pareto-optimal options, which stretches them across the whole axis and makes the differences between them easier to see, at the cost of saying nothing about how they compare with the rest. The axis labels, interactive hover ranks and caption name whichever is used. With “pareto_front”, grey dominated lines that fall off the chart are drawn at its edge.