fig_carrier_rasm

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

Generate a figure contrasting carrier RASM for one or more runs.

RASM (Revenue per Available Seat Mile) is computed by the underlying summary tables and pulled via _assemble().

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.

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 RASM 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.