Creates an animated scanpath: fixations appear one at a time (by order or by onset), earlier fixations stay visible as faded marks, and colour encodes onset on the shared eyesim time scale.
Arguments
- x
A `fixation_group` object.
- bg_image
An optional image file name (or `cimg`) to use as the background.
- xlim
The range in x coordinates (default: range of x values in the fixation group).
- ylim
The range in y coordinates (default: range of y values in the fixation group).
- alpha
The opacity of each dot (default: 1).
- anim_over
Animate over index (ordered) or onset (real time) (default: c("index", "onset")).
- type
Display as points or a raster (default: c("points", "raster")).
- time_bin
The size of the time bins (default: 1).
See also
Other visualization:
element_text_wrap(),
eyesim_colours(),
plot.eye_density(),
plot.fixation_group(),
scale_fill_eyesim_density(),
theme_eyesim()
Examples
# Create a fixation group
fg <- fixation_group(x=c(.1,.5,1), y=c(1,.5,1), onset=1:3, duration=rep(1,3))
# Animate the scanpath for the fixation group
if (requireNamespace("gganimate", quietly = TRUE)) {
anim_sp <- anim_scanpath(fg)
}