suboptimumg.plotting.internal_data_plots#
- suboptimumg.plotting.internal_data_plots.plot_competition_traces(competitions, x_axis, *, labels=None, title=None, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#
Plot one subplot for each event in a competition, displaying velocity, accel, and power traces.
Allows overlaying traces across multiple competitions.
- Parameters:
competitions (CompetitionResults or List[CompetitionResults]) – Competition results to plot
x_axis (Axis) – Axis to use for the x-axis (distance or time)
labels (List[str], optional) – Labels for each competition (e.g., [“baseline”, “new_config”]). If not provided, defaults to “comp_0”, “comp_1”, etc.
title (str, optional) – Plot title
layout_config (LayoutConfig, optional) – Layout configuration object
font_config (FontConfig, optional) – Font configuration object
- Returns:
Plotly figure object
- Return type:
go.Figure
- suboptimumg.plotting.internal_data_plots.plot_event_traces(results, x_axis, *, labels=None, metrics=[Metric.VELOCITY, Metric.ACCEL, Metric.POWER], title=None, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#
Plot final velocity, acceleration, and power traces on a single plot.
Allows overlaying traces across multiple lapsims for direct comparison of different vehicle configurations.
- Parameters:
results (LapsimResults or List[LapsimResults]) – Results to plot. Pass a list to overlay multiple configurations.
x_axis (Axis) – Axis to use for the x-axis (distance or time)
labels (List[str], optional) – Labels for each result set (e.g., [“baseline”, “new_config”]). If not provided, defaults to “run_0”, “run_1”, etc.
metrics (List[Metric], optional) – Metrics to plot. Defaults to all three (velocity, accel, power)
title (str, optional) – Plot title
layout_config (LayoutConfig, optional) – Layout configuration object
font_config (FontConfig, optional) – Font configuration object
- Returns:
Plotly figure object
- Return type:
go.Figure
- suboptimumg.plotting.internal_data_plots.plot_internal_keys(results, keys, x_axis, *, title=None, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#
Plot any tracked internal variables (top-level or per-seed) by key name.
Provided for back compatibility and more flexible access.
- Parameters:
results (List[LapsimResults]) – List of lapsim results to plot
keys (List[str]) – List of keys to plot
x_axis (Axis) – Axis to use for the x-axis (distance or time)
title (str, optional) – Plot title
layout_config (LayoutConfig, optional) – Layout configuration object
font_config (FontConfig, optional) – Font configuration object
- Returns:
Plotly figure object
- Return type:
go.Figure
Notes
Possible key names: - Internal Data top-level keys:
v_max_profile,seed_idx_list,cumulative_dist- LapsimResults top-level keys:lap_t,lap_dxs,lap_vels,lap_accs,lap_powers,lap_eff_motor_torques- Per-seed keys in the form{field}_seed_{n}(e.g.v_proposal_seed_2)
- suboptimumg.plotting.internal_data_plots.plot_per_seed(results, x_axis, *, include_indices=None, include_power=True, title=None, font_config=FontConfig(large=24, medium=16, small=12), layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'))[source]#
Draws one subplot per seed index showing velocity proposals, accel, power, and masks.
Allows overlaying seed traces across multiple lapsims.
- Parameters:
results (LapsimResults or List[LapsimResults]) – For consistency, these should be the same event across different runs
x_axis (Axis) – Use distance or time for the x-axis
include_indices (List[int], optional) – Specify which seeds to include. e.x. [0, 1] only includes first two seeds. Defaults to all seeds found.
include_power (bool, optional) – Include power proposals (kW). True by default
title (str, optional) – Plot title
font_config (FontConfig, optional) – Font configuration object
layout_config (LayoutConfig, optional) – Layout configuration object
- Returns:
Plotly figure object
- Return type:
go.Figure