fig_carrier_local_share

passengersim.contrast.fig_carrier_local_share(summaries, load_measure: 'bookings' | 'leg_pax' = 'bookings', raw_df=False, orient: 'h' | 'v' = 'h', ratio: str | bool = 'all', *, width: int = 500, also_df: bool = False)[source]

Generate a figure contrasting carrier local shares for one or more runs.

Parameters:
summaries : dict[str, SimulationTables]

One or more SimulationTables to compare.

load_measure : {'bookings', 'leg_pax'}, default 'bookings'

Whether to measure local share as a percentage of bookings or of leg passengers.

raw_df : bool, default False

Return only the raw data used to generate the figure.

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 local share 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.

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.