Learn R Programming

mousetrap (version 1.2.0)

mt_plot_per_trajectory: Create pdf with separate plots per trajectory.

Description

mt_plot_per_trajectory creates a PDF file with separate plots per trajectory. This PDF can be used for inspecting individual trajectories. Note that plotting all trajectories can be time-consuming, especially for raw trajectories. If the appropriate x and y arguments are inserted, this function can also be used for plotting velocity and acceleration profiles.

Usage

mt_plot_per_trajectory(file, data, use = "trajectories", x = "xpos", y = "ypos", show_progress = TRUE, ...)

Arguments

file
a character string specifying the name of the pdf file. Passed on to pdf.
data
a mousetrap data object created using one of the mt_import functions (e.g., mt_import_mousetrap).
use
a character string specifying which trajectories should be plotted. The corresponding trajectories are selected from data using data[[use]]. Usually, this value corresponds to either "trajectories", "tn_trajectories" or "av_trajectories", depending on whether the raw, time-normalized or averaged trajectories should be plotted.
x
a character string specifying which dimension in the trajectory array should be displayed on the x-axis (defaults to xpos).
y
a character string specifying which dimension in the trajectory array should be displayed on the y-axis (defaults to ypos).
show_progress
logical indicating whether function should report its progress.
...
additional arguments passed on to pdf.

Details

mt_plot_per_trajectory creates a pdf using pdf. Next, it plots all trajectories individually using mt_plot. Every plot is labeled using the mt_id variable.

See Also

mt_plot for plotting trajectory data.

Examples

Run this code
## Not run: 
# mt_plot_per_trajectory(mt_example,
#   file="trajectories.pdf",
#   use="trajectories")
# ## End(Not run)

Run the code above in your browser using DataLab