Plot the trace of IMU values from an IMU vector with time on the x-axis.
Arguments
- x
An IMU vector (
acc,mag, orgyro)- ...
Passed to
dygraphs::dygraph()(for instance, to label axes).
Value
A dygraphs::dygraph() with one series per IMU axis.
Details
If the bursts in the input come from multiple sources, traces may be combined incorrectly. See examples.
See also
plot_sampling_effort() to plot sample collection times.
Examples
plot_imu_trace(acc_example())
# If bursts come from multiple sources (in this case, deployments),
# then lines from different bursts may be incorrectly connected:
alb <- albatrosses()
a <- as_acc(alb)
plot_imu_trace(a)
# To avoid this issue, plot only a single deployment's values:
plot_imu_trace(a[move2::mt_track_id(alb) == "4261-2228"])
# Label axes by passing arguments to `dygraph()`:
plot_imu_trace(acc_example(), main = "Wing beats", ylab = "Acceleration (g)")
# Use other `dygraphs` layers to further modify the plot. For instance,
# to label the time axis in UTC instead of the browser time zone:
plot_imu_trace(acc_example()) |>
dygraphs::dyOptions(labelsUTC = TRUE)
# The data used to build the plot keep a time zone record. You can plot
# the trace in the data time zone as follows. (Note that this may produce a
# blank plot for some dygraphs distributions.)
plot_imu_trace(acc_example()) |>
dygraphs::dyOptions(useDataTimezone = TRUE)