Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


Rtrack (version 1.0.7)

plot_density: Plot a path density map.

Description

Plots a density map ('heatmap') of the path.

Usage

plot_density(
  metrics,
  title = NULL,
  col = (grDevices::colorRampPalette(c("#FCFBFD", "#9E9AC8", "#3F007D")))(256),
  legend = TRUE,
  goal.col = "black",
  goal.lwd = 2,
  resolution = 600,
  margins = c(0, 2, 4, 2),
  ...
)

Arguments

metrics

An rtrack_metrics object from calculate_metrics.

title

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

col

Colours for the density map. These can be provided as any vector of colours. The recommended (and default) approach is to use colorRampPalette. The default colouring is a simple white-to-blue scale.

legend

Should a colour scale legend be drawn? Default is TRUE.

goal.col

The colour to plot the goal outlines. Black by default, but it may be useful to change this if a very dark colour scheme is used.

goal.lwd

The width of the lines used to plot the goals. By default this is drawn heavier to make them stand out.

resolution

The resolution of the heatmap in pixels. The default is 600 x 600.

margins

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

...

Additional arguments passed to the plot method in the SpatialPolygons-class to modify plot details.

See Also

calculate_metrics, plot_path.

Examples

Run this code
require(Rtrack)
track_file <- system.file("extdata", "Track_1.csv", package = "Rtrack")
arena_description <- system.file("extdata", "Arena_SW.txt", package = "Rtrack")
arena <- read_arena(arena_description)
path <- read_path(track_file, arena, track.format = "ethovision.3.csv")
metrics <- calculate_metrics(path, arena)
plot_density(metrics)

Run the code above in your browser using DataLab