plots.plot_outlier_runs
plots.plot_outlier_runs(
event_log,
first_event,
second_event,
*,
what='mean',
match='first',
warm_up=0,
iqr_multiplier=1.5,
marker_size=10,
spacing=None,
**col_kwargs,
)Horizontal beeswarm of per-replication values, flagging outlier runs.
Visualises vidigi.analysis.flag_outlier_runs: each run’s per-replication value is drawn as a point, spread vertically into a beeswarm layout so close-together values stay individually visible rather than overlapping on one line, coloured (and shaped, for a colourblind-safe second cue) by whether Tukey’s fence flags it as an outlier. Shaded red bands, with a dashed boundary line, mark the region beyond each fence.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| event_log | pandas.DataFrame | Long-format event log spanning one or more runs. | required |
| first_event | str | The two events to pair - see vidigi.analysis.event_durations. |
required |
| second_event | str | The two events to pair - see vidigi.analysis.event_durations. |
required |
| what | str | The per-replication statistic to compute - see vidigi.analysis.replication_means. |
"mean" |
| match | (first, last, occurrence) | How repeated occurrences of the two events are paired. | "first" |
| warm_up | float | Pairings whose first_time is before warm_up are excluded. |
0 |
| iqr_multiplier | float | Fence width in IQRs - see vidigi.analysis.flag_outlier_runs. |
1.5 |
| marker_size | float | Marker size for each run’s point. | 10 |
| spacing | float | Minimum x-distance (in the same units as the plotted statistic) between two points before the beeswarm pushes one onto another row. None (default) uses a twentieth of the value range - a reasonable default at a normal figure size, not a pixel-exact computation (this function has no way to know the rendered figure size), so a much wider or narrower width=/height= than usual may want an explicit value. |
None |
| **col_kwargs | dict | Column-name keyword arguments forwarded to vidigi.analysis.event_durations, e.g. run_col_name=. |
{} |
Returns
| Name | Type | Description |
|---|---|---|
| plotly.graph_objects.Figure |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If no complete pairs are found in any run, or iqr_multiplier is negative. |
See Also
vidigi.analysis.flag_outlier_runs : The underlying implementation. plot_replication_analysis : A different per-replication diagnostic (precision, not outliers).
Examples
>>> plot_outlier_runs(trial.to_dataframe(), "start", "end")
<plotly.graph_objs._figure.Figure>