
Interactive 3D surface plot of EEG signal over time
interactive_surfaceplot_curves.RdCreates an interactive 3D surface plot displaying the EEG signal amplitude across different sensors and time points. The x-axis represents time, the y-axis represents the sensors, and the z-axis (along with surface color) represents the signal amplitude.
Usage
interactive_surfaceplot_curves(
data,
amplitude,
sensor_ticks = NULL,
col_range = NULL,
col_scale = NULL
)Arguments
- data
A data frame, tibble, or a database table containing the EEG data. Required columns are:
sensor,time, and the column with the EEG amplitude specified in the argumentamplitude.- amplitude
A character string specifying the name of the column from the input data containing EEG amplitude values.
- sensor_ticks
A character vector specifying which sensor labels should be displayed on the y-axis. If
NULL, no specific labels are forced, but mismatched names will throw an error if provided.- col_range
A vector with minimum and maximum value of the amplitude used in the colour palette for plotting. If not defined, the range of interpolated signal is used.
- col_scale
Optionally, a colour scale to be utilised for plotting. If not defined, it is computed from
col_range.
Value
A plotly widget object containing the interactive 3D surface plot.
Additionally, the returned object carries a "diegr_metadata" attribute with metadata.
Examples
# \donttest{
# Prepare data: Mean across epochs 1:13 for Subject 2
edata <- pick_data(epochdata, subject_rg = 2, epoch_rg = 1:13)
data_base <- baseline_correction(edata, baseline_range = 1:9)
data_mean <- compute_mean(data_base, amplitude = "signal_base", type = "point", domain = "time")
# Selected sensors to display on the axis
selected_sensors <- c("E1", "E21", "E41", "E61", "E81", "E101",
"E121", "E141", "E161", "E181", "E201", "E221")
# Render the interactive plot
interactive_surfaceplot_curves(data_mean, amplitude = "average", sensor_ticks = selected_sensors)
# }