plot_population_impact_summary

site_solutions.SolutionComparator.plot_population_impact_summary(
    by='demand',
    matrix=None,
    demand=None,
    meaningful_change_threshold=0.0,
    config_a=None,
    config_b=None,
    colors=('#9fb8ad', '#1b7a5e'),
    figsize=(9, 4),
    title='default',
    ax=None,
)

Two-panel bar chart pairing population_impact_summary()’s region-wide and per-region views: the weighted_average shift between set_a (baseline) and set_b (candidate) on the left, against how many people (or regions) actually experienced a change on the right. Makes visible the “dilution” a region-wide average alone can hide – a large, genuinely local effect can move weighted_average by very little once averaged across everyone else who is unaffected by it.

Parameters

Name Type Description Default
by (demand, regions) Whether the right-hand panel counts people (demand_improved/demand_unchanged, demand-weighted) or regions (regions_improved/regions_unchanged). “demand” raises ValueError if no demand data is registered on the problem, matching site_allocation_summary()’s by="demand" behaviour; “regions” always works. "demand"
matrix Passed straight through to population_impact_summary(). None
demand Passed straight through to population_impact_summary(). None
meaningful_change_threshold Passed straight through to population_impact_summary(). None
config_a Passed straight through to population_impact_summary(). None
config_b Passed straight through to population_impact_summary(). None
colors (str, str) (unchanged_color, changed_color). The left panel always colours set_a with unchanged_color and set_b with changed_color; the right panel colours the “improved” bar with changed_color and “unchanged” with unchanged_color. ("#9fb8ad", "#1b7a5e")
figsize tuple Figure size, ignored if ax is given. (9, 4)
title str Overall figure title. If “default”, an automatic title is generated. "default"
ax (matplotlib.axes.Axes, matplotlib.axes.Axes) A pair of existing Axes to draw the two panels into instead of creating a new figure – e.g. to embed this as two panels of a larger layout. None

Returns

Name Type Description
(matplotlib.figure.Figure, (matplotlib.axes.Axes, matplotlib.axes.Axes))
Back to top