Highlighted text¶
Highlight a selected text span alongside its fixations.
- Load a Words table with a true/false column that marks the words to highlight, and your Fixations table. Open the dataset in the Scanpath view and pick a trial in Select trial.
- In Stimulus ▾, tick Highlight words and choose that column.
- Under Style, keep Mark text and pick the highlight color in the box beside it. To show only the highlighted text and the fixations, turn off Saccades.
import scanpath_studio as sps
words, fixations = sps.load_sample_data()
pid, tid = "l37_1129", "l37_1129_2_1_1_Ele"
fig = sps.plot_scanpath(
words,
fixations,
pid,
tid,
highlight_column="is_in_aspan",
critical_span_style="Mark text",
show_saccades=False,
)
sps.save_figure(fig, "highlighted-text.html")