plot_population_impact_by_equity_group

site_solutions.SolutionComparator.plot_population_impact_by_equity_group(
    matrix=None,
    demand=None,
    meaningful_change_threshold=0.0,
    config_a=None,
    config_b=None,
    colors=('#1b7a5e', '#b23a48'),
    figsize=(10, 5),
    title='default',
    ax=None,
)

Bar chart of population_impact_by_equity_group()’s rate- normalised improved/worsened proportions – one paired bar per equity band, ordered most- to least-disadvantaged.

Deliberately plots BOTH directions side by side rather than only the improved rate: a candidate can win on weighted_average while making some disadvantaged areas worse off, and a benefits-only chart would hide exactly that. Each bar is a share of THAT band’s own population (not a share of the region-wide improved/worsened total), so bands with different population sizes are directly comparable.

Parameters

Name Type Description Default
matrix Passed straight through to population_impact_by_equity_group(). None
demand Passed straight through to population_impact_by_equity_group(). None
meaningful_change_threshold Passed straight through to population_impact_by_equity_group(). None
config_a Passed straight through to population_impact_by_equity_group(). None
config_b Passed straight through to population_impact_by_equity_group(). None
colors (str, str) (improved_color, worsened_color). ("#1b7a5e", "#b23a48")
figsize tuple Figure size, ignored if ax is given. (10, 5)
title str Plot title. If “default”, an automatic title is generated. "default"
ax matplotlib.axes.Axes An existing Axes to draw into instead of creating a new figure – e.g. to embed this in a larger layout. None

Returns

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

Raises

Name Type Description
ValueError If no equity data is registered on the problem, or any of the errors population_impact_summary() raises – see population_impact_by_equity_group().
Back to top