fig_service_shifts

passengersim.contrast.duo.fig_service_shifts(baseline: SimulationTables, treatment: SimulationTables, *, coloring: 'avg_revenue' | 'change_revenue' | None = 'avg_revenue', size_range: tuple[int, int] = (10, 100), facet_width: int = 400, facet_height: int = 400, facet_columns: int = 2, opacity: float = 1.0, fillOpacity: float = 1.0, strokeOpacity: float = 1.0, strokeWidth: float = 1.0)[source]

Create a scatter/shift chart comparing service-level metrics between two simulations.

For each O&D service, a “lollipop” is drawn, with the stick showing the shift from the baseline to the treatment position in load-factor vs. local-share space, and the point marking the treatment result. Services are the aggregation of all legs sharing a common carrier, origin, and destination.

Parameters:
baseline : SimulationTables

Simulation results to use as the reference (baseline) scenario.

treatment : SimulationTables

Simulation results to compare against the baseline (treatment) scenario.

coloring : {"avg_revenue", "change_revenue"}, optional

Determines how points and lines are colored:

  • "avg_revenue" – color by absolute average revenue in the treatment.

  • "change_revenue" – color by the absolute change in average revenue (treatment minus baseline), using a diverging red-blue scale centered at 0.

  • None – color by carrier (nominal color encoding).

size_range : tuple[int, int], optional

Minimum and maximum point sizes (in pixels²) used to encode service capacity.

facet_width : int, optional

Width of each facet panel in pixels.

facet_height : int, optional

Height of each facet panel in pixels.

facet_columns : int, optional

Number of columns in the faceted layout (one facet per carrier).

opacity : float, optional

Overall opacity of the point marks.

fillOpacity : float, optional

Fill opacity of the point marks.

strokeOpacity : float, optional

Stroke opacity of both point and line marks.

strokeWidth : float, optional

Stroke width of the line (rule) marks.

Returns:

altair.FacetChart – An interactive Altair faceted chart (faceted by carrier) showing the shift in load factor and local share for each service between baseline and treatment.