1 | plot_fixation(data, fixations, durationLimit = 0)
|
data |
|
fixations |
|
durationLimit |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (data, fixations, durationLimit = 0)
{
par(mar = c(0, 0, 0, 0))
plot(data$GazePointX[!is.na(data$GazePointX)], 1 - data$GazePointY[!is.na(data$GazePointY)],
cex = 0.1, col = "red", xlim = c(0, 1), ylim = c(0, 1))
lines(data$GazePointX[!is.na(data$GazePointX)], 1 - data$GazePointY[!is.na(data$GazePointY)],
col = "red")
points(data$GazePointX[1], 1 - data$GazePointY[1], col = "green",
cex = 3, pch = 20)
for (i in 1:nrow(fixations)) {
if ((fixations$FixationIndex[i] >= 1) & (fixations$FixationDuration[i] >
durationLimit)) {
pointSize <- 5 * fixations$FixationDuration[i]/max(fixations$FixationDuration)
points(fixations$MappedFixationPointX[i], 1 - fixations$MappedFixationPointY[i],
col = "blue", cex = pointSize, pch = 1)
}
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.