R/plotting.R
illustrate_extrapolation.Rd
illustrate_extrapolation
plots elements of extrapolations
(e.g., marked points, reference lines) in the same style as
illustrate_signal
.
illustrate_extrapolation(
df,
dynamic_range,
title = NULL,
show_neighbors = TRUE,
show_extrapolated_points_and_lines = TRUE,
...
)
data.frame.The original data before extrapolation.
numerical vector. The dynamic ranges of the input
signal. Should be a 2-element numerical vector. c(low, high)
, where
low
is the negative max value the device can reach and high
is the positive max value the device can reach.
Char. The title of the plot.
bool. Show the points used for extrapolation if TRUE.
bool. Show the extrapolated points and curves used for extrapolation.
Parameters that can be used to tune extrapolation, including
spar
, k
, and noise_level
. See extrapolate
for explanations.
ggplot2 graph object. The graph to be shown.
Other visualization functions.:
generate_interactive_plot()
,
illustrate_signal()
# Use the maxed-out data for the conceptual diagram
df = conceptual_diagram_data[
conceptual_diagram_data['GRANGE'] == 2,
c("HEADER_TIME_STAMP", "X")]
# Plot extrapolation illustration using default settings
illustrate_extrapolation(df, dynamic_range=c(-2,2))
#> Warning: collapsing to unique 'x' values
# Do not show neighbor points
illustrate_extrapolation(df, dynamic_range=c(-2,2), show_neighbors=FALSE)
#> Warning: collapsing to unique 'x' values
# Do not show extrapolated points and lines
illustrate_extrapolation(df,
dynamic_range=c(-2,2),
show_extrapolated_points_and_lines=FALSE)
#> Warning: collapsing to unique 'x' values