fig_fare_class_mix¶
-
passengersim.contrast.fig_fare_class_mix(summaries: dict[str, SimulationTables], *, raw_df: bool =
False, also_df: bool =False, label_threshold: float =0.06) Chart | DataFrame | tuple[Chart, DataFrame][source]¶ Generate a figure contrasting carrier fare class mix for one or more runs.
Displays stacked bar charts of average seats sold per booking class for each carrier and source, making it easy to compare how fare class mix shifts across simulation scenarios.
- Parameters:
- summaries : dict[str, SimulationTables]¶
One or more SimulationTables to compare. The keys are used as source labels in the chart.
- 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. Smaller segments are unlabeled to avoid clutter.
- Returns:
alt.Chart or pd.DataFrame or tuple[alt.Chart, pd.DataFrame] – The Altair chart, or the raw DataFrame if
raw_dfis True, or a(chart, dataframe)tuple ifalso_dfis True.