fig_carrier_load_factors

passengersim.contrast.fig_carrier_load_factors(summaries: dict[str, SimulationTables], raw_df: bool = False, load_measure: 'sys_lf' | 'avg_leg_lf' = 'sys_lf', orient: 'h' | 'v' = 'h', ratio: str | bool = 'all', *, width: int = 500, also_df: bool = False, title: str | None = '_default_')[source]

Generate a figure contrasting carrier load factors for one or more runs.

Parameters:
summaries : dict[str, SimulationTables]

One or more SimulationTables to compare.

raw_df : bool, default False

Return only the raw data used to generate the figure.

load_measure : {'sys_lf', 'avg_leg_lf'}, default 'sys_lf'

Which load factor metric to display: system load factor ('sys_lf') or average leg load factor ('avg_leg_lf').

orient : {'h', 'v'}, default 'h'

Chart orientation; 'h' for horizontal bars, 'v' for vertical.

ratio : str or bool, default "all"

Add tooltip(s) giving the percentage change of each carrier’s load factor relative to a reference source. Pass a source-label string to specify the reference, or 'all' to compare against all other sources.

width : int, default 500

Width of each bar panel in pixels.

also_df : bool, default False

If True, return a tuple of (figure, dataframe) instead of just the figure.

title : str, optional

Title of the figure. Pass None for no title; if not provided, a default title is derived from load_measure.

Returns:

alt.Chart or pd.DataFrame or tuple[alt.Chart, pd.DataFrame] – The Altair chart, or the raw DataFrame if raw_df is True, or a (chart, dataframe) tuple if also_df is True.