Reading schematic¶
A hand-drawn two-line text, with one fixation per word in reading order: The → cat → sat → on → the → mat. Fixations sit on the lines and saccades are arcs.
- Load your Words and Fixations tables, or the example words and fixations. For the example, set Recording setup → Screen to I know it, 450 × 340 px.
- Open the dataset in the Scanpath view and pick a trial in Select trial.
- In Fixations ▾, tick Snap → To line and Fixation index → Show. In Saccades ▾ → Shape, choose Arc.
- In Figure & canvas ▾ → Legends, untick Show for Fixation sizes. Under Title & labels → Illustration, enter “Illustration · hand-drawn” in Text.
import scanpath_studio as sps
from scanpath_studio.synthetic import make_synthetic_words
words = make_synthetic_words()
fixations = words[["participant_id", "trial_id", "text_id", "word_id"]].copy()
fixations["x"] = words["x"] + words["width"] / 2
fixations["y"] = words["y"] + words["height"] / 2
fixations["duration_ms"] = [100, 150, 120, 200, 90, 110]
fixations["timestamp_ms"] = (
fixations["duration_ms"].cumsum() - fixations["duration_ms"]
)
fixations["order_in_trial"] = range(1, len(fixations) + 1)
fixations["pass_index"] = 1
pid, tid = "synthetic", "synthetic_2line_demo"
fig = sps.plot_scanpath(
words,
fixations,
pid,
tid,
canvas_size=(450, 340),
fixation_snap_to_line=True,
saccade_render_mode="Arc",
illustration_text="Illustration · hand-drawn",
show_order=True,
duration_size_legend=False,
)
sps.save_figure(fig, "illustration.html")