plot_comparison

site_solutions.SolutionComparator.plot_comparison(
    config_1=None,
    config_2=None,
    figsize=(16, 8),
    title=None,
    title_fontsize=14,
    **shared_plot_kwargs,
)

Plot solutions from both solution sets side-by-side.

Convenience wrapper around plot_solution_sets_comparison() for comparing the two solution sets managed by this comparator.

Parameters

Name Type Description Default
config_1 dict Configuration for plotting from solution_set_1. If None, plots the best solution (solution_rank=1). None
config_2 dict Configuration for plotting from solution_set_2. If None, plots the best solution (solution_rank=1). None
figsize tuple Figure size as (width, height) in inches. (16, 8)
title str Overall figure title. If None, generates a default title. None
title_fontsize int Font size for the overall figure title. 14
**shared_plot_kwargs Keyword arguments applied to both subplots. {}

Returns

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

Examples

Compare best solutions from both sets

fig, axes = comparator.plot_comparison()

Compare specific site configurations

balanced_car, balanced_pt = comparator.get_balanced_solution() fig, axes = comparator.plot_comparison( config_1={‘site_indices’: balanced_car}, config_2={‘site_indices’: balanced_pt}, title=‘Balanced Solutions: Car vs Public Transport’ )

Compare ranked solutions

fig, axes = comparator.plot_comparison( config_1={‘solution_rank’: 2, ‘sort_by’: ‘weighted_average’}, config_2={‘solution_rank’: 2, ‘sort_by’: ‘weighted_average’}, title=‘2nd Best Solutions Comparison’ )

Back to top