Highlighted text¶
Highlight a selected text span alongside its fixations.
- Select the bundled demo, participant
l37_1129, triall37_1129_2_1_1_Ele_r0. Reset visualization. - In Stimulus → Highlight, turn on Show and choose
is_in_aspanas the word column. - Turn off Saccades. The orange words mark the trial’s answer span.
import scanpath_studio as sps
words, fixations = sps.load_sample_data()
pid, tid = "l37_1129", "l37_1129_2_1_1_Ele_r0"
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")