champpy.MobPlotter

The MobPlotter is a factory class to visualize synthetic mobility profiles in CHAMPPy. Different plots are are created with the Python library plotly and merged in a html file. The MobPlotter can be used to analyze the generated synthetic mobility profiles and to compare different mobility profiles, e.g,, reference profiles vs. modelled profiles.

The generated html file contain the following plots:

  • 📊 Bar charts of mobility characteristics: daily kilometrage, daily journey time, number of journeys per day

  • 📈 Histogram of mobility characteristics per day, per vehicle and per journey: daily kilometrage, daily journey time, number of journeys per day.

  • 📍 Locations of the mobility profiles over the average week

Basic workflow:

  1. Initialize the plotter MobPlotter with user parameters UserParamsMobPlotter

  2. Call plot_mob_profiles() to create plots of MobProfiles.

  3. Analyze the genertaed plots in html format, that opens automatically after the plot is created.

class champpy.MobPlotter(user_params=UserParamsMobPlotter(filename='mob_plots.html', font_family='Segoe UI', save_plot=True, show=True, font_size=18, rgb_color=[[0.2078, 0.4235, 0.6471], [0.9686, 0.8353, 0.0275], [0.5412, 0.7098, 0.8824], [0.6706, 0.149, 0.149], [0.1216, 0.3059, 0.4745], [0.9255, 0.5765, 0.0078], [0.4784, 0.1098, 0.1098]], location_temp_res=1, location_order=[], clustering=False))[source]

Plotter for mobility profiles MobProfiles.

This class provides multiple plotting utilities for mobility datasets, including summary characteristics, histograms, and location profiles.

Parameters:

user_params (Optional[UserParamsMobPlotter]) – Plot configuration such as output filename, font, colors, and display/export behavior.

plot_mob_profiles(mob_profiles)[source]

Main function to generate plots of mobility profiles MobProfiles. The function calls plot_mob_char(), plot_hist(), and plot_location_profile_week() to create a combined HTML file.

Parameters:

mob_profiles (MobProfiles | MobProfilesExtended) – Input mobility profiles that are to be visualized.

Returns:

The method writes/opens a combined HTML plot report depending on user settings.

Return type:

None

plot_mob_char(mob_profiles)[source]

Plot the mobility characteristics: daily kilometrage, daily triptime, and number of trips per day.

Parameters:

mob_profiles (MobProfiles | MobProfilesExtended) – Mobility profiles to plot.

Returns:

Plotly figure object.

Return type:

Figure

plot_hist(mob_profiles)[source]

Plot the histogram of the mobility characteristics from mobility data.

Parameters:

mob_profiles (MobProfiles | MobProfilesExtended) – Mobility profiles to plot.

Returns:

Plotly figure object.

Return type:

Figure

plot_location_profile_week(mob_profiles)[source]

Create a plot showing the average presence of a vehicle fleet at different locations.

Parameters:

mob_profiles (MobProfiles | MobProfilesExtended) – Mobility data used for deriving weekly location shares.

Returns:

Plotly figure object for weekly location profile visualization.

Return type:

Figure

show_rgb_colors()[source]

Show the RGB colors used in the plots as a bar chart.

class champpy.UserParamsMobPlotter(*args, **kwargs)[source]

Data class with user parameters for MobPlotter.

The user parameter values control the output behavior, styling, and plotting options for mobility visualization.

filename: str = 'mob_plots.html'

Output filename for combined plot export.

font_family: str = 'Segoe UI'

Font family used in plots.

save_plot: bool = True

If True, export plot output to an HTML file.

show: bool = True

If True, open/show generated plots.

font_size: int = 18

Base font size used across all plots.

rgb_color: list | None

RGB color matrix used for cluster and area coloring.

location_temp_res: int | None = 1

Temporal resolution in hours for location profile plot.

location_order: list | None

Optional explicit location order for location profile plot.

clustering: bool | None = False

If True, the clusters in MobProfiles are considered and cluster-specific plots are generated.