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:
Initialize the plotter
MobPlotterwith user parametersUserParamsMobPlotterCall
plot_mob_profiles()to create plots ofMobProfiles.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 callsplot_mob_char(),plot_hist(), andplot_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
- 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.
- clustering: bool | None = False¶
If
True, the clusters inMobProfilesare considered and cluster-specific plots are generated.