plot_solution_comparison

site.SiteSolutionSet.plot_solution_comparison(
    solutions_config,
    figsize=(16, 8),
    title=None,
    title_fontsize=14,
    **shared_plot_kwargs,
)

Plot multiple solutions side-by-side for comparison.

Parameters

Name Type Description Default
solutions_config list of dict List of configuration dictionaries for each subplot. Each dict can contain any parameters accepted by plot_best_combination(), e.g.: - ‘solution_rank’: int - ‘site_names’: list of str - ‘site_indices’: list of int or np.ndarray - ‘sort_by’: str - ‘title’: str (subplot title) - Any other plot_best_combination() parameters required
figsize tuple Figure size as (width, height) in inches. (16, 8)
title str Overall figure title (suptitle). If None, no suptitle is added. None
title_fontsize int Font size for the overall figure title. 14
**shared_plot_kwargs Keyword arguments applied to all subplots. Individual subplot configs override these shared settings. {}

Returns

Name Type Description
tuple (fig, axes) where fig is the Figure and axes is an array of Axes objects.

Examples

Compare best vs 2nd best solution

fig, axes = solver.plot_solution_comparison([ {‘solution_rank’: 1, ‘title’: ‘Best Solution’}, {‘solution_rank’: 2, ‘title’: ‘2nd Best Solution’}])

Compare specific site combinations

fig, axes = solver.plot_solution_comparison([ {‘site_names’: [‘Site A’, ‘Site B’, ‘Site C’]}, {‘site_names’: [‘Site D’, ‘Site E’, ‘Site F’]}], show_all_locations=False)

Three-way comparison with custom ranking

fig, axes = solver.plot_solution_comparison([ {‘solution_rank’: 1, ‘sort_by’: ‘weighted_average’}, {‘solution_rank’: 1, ‘sort_by’: ‘max’}, {‘solution_rank’: 1, ‘sort_by’: ‘proportion_within_coverage_threshold’}], figsize=(24, 8))

Back to top