Skip to contents

Plots a heatmap of raw data.

Usage

plot_heatmap(
  data = NULL,
  trial_number = NULL,
  bg_image = NULL,
  res = c(0, 1920, 0, 1080),
  flip_y = FALSE,
  alpha_control = 0.1,
  plot_header = FALSE
)

Arguments

data

data in standard raw data form (time, x, y, trial)

trial_number

can be used to select particular trials within the data

bg_image

The filepath of an image to be added to the plot, for example to show a screenshot of the task.

res

resolution of the display to be shown, as a vector (xmin, xmax, ymin, ymax)

flip_y

reverse the y axis coordinates (useful if origin is top of the screen)

alpha_control

a single value to determine how much of the heatmap to obscure. Between 0 and 1. Lower values include more data in the heatmap

plot_header

display the header title text which explains graphical features of the plot.

Value

a plot of the raw data

Examples

# \donttest{
data <- combine_eyes(HCL)
data <- data[data$pNum == 118,]
# plot all trials data
plot_heatmap(data, alpha_control = .01)
#> Warning: Removed 320 rows containing non-finite outside the scale range
#> (`stat_density2d()`).
#> Warning: Removed 396 rows containing missing values or values outside the scale range
#> (`geom_tile()`).


#plot one trial
plot_heatmap(data, trial_number = 1)
#> Warning: Removed 121 rows containing non-finite outside the scale range
#> (`stat_density2d()`).
#> Warning: Removed 396 rows containing missing values or values outside the scale range
#> (`geom_tile()`).


# }