Plots the path together with a representation of the arena.

  title = NULL,
  quadrants = FALSE,
  highlight = TRUE,
  margins = c(0, 0, 3, 0),
  path.lwd = NA,
  lwd = 1



A metrics object from calculate_metrics.


An optional title for the plot. The default is to use the path name saved in the metrics object.


Should the quadrants be marked on the plot. Default is FALSE


Should key features of the path be highlighted? Default is TRUE. The type of highlight depends on the plot type: For Morris water maze and Barnes maze, this will draw the section of the path equivalent in length to the distance between the start and the goal in red. For active place avoidance, the perimeter of the arena is annotated with a red point at the median and a line extending from the lower to the upper quartile. For other experiment types, this parameter is currently ignored.


The margins of the plot (see the option mar in par). The defaults should normally not need to be changed.


The thickness of the line used to draw the path. By default this is drawn heavier to make them stand out.


The thickness of the lines used to draw the arena. Default is 1.


The path is plotted together with the context of the arena. The three concentric zones of the arena (the wall, outer wall and annulus) are drawn in progressively lighter shades of blue. The goal is a filled circle in orange and the old goal is drawn in grey. The direct path to goal is shown as a broken orange line and the "approach corridor" (in transparent orange) is defined as a triangle fanning out from this line by 20 degrees either side. The path itself is drawn in black with the initial path (the section of the path equivalent in length to the distance between the start and the goal) drawn in red if highlight = TRUE.

See also

calculate_metrics, and also read_experiment for processing many tracks at once.


track_file <- system.file("extdata", "", package = "Rtrack")
arena_description <- system.file("extdata", "Arena.txt", package = "Rtrack")
arena <- read_arena(arena_description)
path <- read_path(track_file, arena, track.format = "")
metrics <- calculate_metrics(path, arena)