fig_od_fare_class_mix

passengersim.contrast.fig_od_fare_class_mix(summaries: dict[str, SimulationTables], orig: str, dest: str, *, raw_df: bool = False, also_df: bool = False, label_threshold: float = 0.06) Chart | DataFrame | tuple[Chart, DataFrame][source]

Generate a figure contrasting O-D fare class mix for one or more runs.

Like fig_fare_class_mix() but restricted to a single origin-destination market. Displays stacked bar charts of average seats sold per booking class for each carrier and source within the specified market.

Parameters:
summaries : dict[str, SimulationTables]

One or more SimulationTables to compare. The keys are used as source labels in the chart.

orig : str

Origin airport code for the market of interest.

dest : str

Destination airport code for the market of interest.

raw_df : bool, default False

If True, return the raw DataFrame instead of the chart.

also_df : bool, default False

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

label_threshold : float, default 0.06

Minimum fraction of the tallest bar that a segment must represent for its inline text label to be shown.

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.