Skip to content

Visualization

plots

Optional plotting helpers (matplotlib or Plotly).

Install with pip install 'simulsi[viz]' (matplotlib) or 'simulsi[plotly]'. Every function returns the figure object and never calls show(), so it works in scripts, notebooks and tests alike.

plot_series

plot_series(result: SimulationResult, keys: Sequence[str] | None = None, *, title: str = 'Time series', ylabel: str = 'value', backend: Backend = 'matplotlib', ax: Any = None) -> Any

Step plot of recorded time series (see SimulationResult.series).

plot_utilization

plot_utilization(result: SimulationResult, resource: str | None = None, *, backend: Backend = 'matplotlib', ax: Any = None) -> Any

Busy units (solid) against available capacity (dashed) for each resource.

plot_timeline

plot_timeline(log: EventLog, *, event_types: Sequence[str] | None = None, max_points: int = 20000, backend: Backend = 'matplotlib', ax: Any = None) -> Any

Each logged event as a dot: x = time, y = event type.

plot_entity_trajectories

plot_entity_trajectories(log: EventLog, *, max_entities: int = 30, end_time: float | None = None, backend: Backend = 'matplotlib', ax: Any = None) -> Any

Gantt chart of entity states from entity.created / entity.state log records.

plot_distribution

plot_distribution(values: Sequence[float] | ndarray[Any, Any], *, title: str = 'Distribution', bins: int = 30, label: str = 'value', confidence: float = 0.95, backend: Backend = 'matplotlib', ax: Any = None) -> Any

Histogram with the mean and its confidence interval marked.

plot_comparison

plot_comparison(comparison: Comparison, metric: str | None = None, *, relative: bool = False, backend: Backend = 'matplotlib', ax: Any = None) -> Any

Difference from baseline per scenario with confidence-interval error bars.

plot_sensitivity

plot_sensitivity(result: SensitivityResult, output: str | None = None, method: str | None = None, *, backend: Backend = 'matplotlib', ax: Any = None) -> Any

Tornado chart of effect sizes, largest at the top.

save_figure

save_figure(fig: Any, path: str, **kwargs: Any) -> None

Save either backend's figure (.png/.svg/.pdf or Plotly .html).