| plot_topo_mean | R Documentation |
Plot a topographic circle or polygon map of the average EEG signal amplitude and its lower and upper confidence interval bounds using topographic colour scale.
The thin-plate spline interpolation model \text{IM:}\; \mathbb{R}^2 \rightarrow \mathbb{R} is used for signal interpolation between the sensor locations.
The output in the form of a ggplot object allows to easily edit the result image properties.
plot_topo_mean(
data,
mesh,
coords = NULL,
template = NULL,
col_range = NULL,
col_scale = NULL,
contour = FALSE,
show_legend = TRUE,
label_sensors = FALSE
)
data |
A data frame, tibble or a database table with input data to plot. It should be an output from |
mesh |
A |
coords |
Sensor coordinates as a tibble or data frame with named |
template |
The kind of sensor template montage used. Currently the only available option is |
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 input data (average and CI bounds) is used. |
col_scale |
Optionally, a colour scale to be utilised for plotting. It should be a list with |
contour |
Logical. Indicates, whether contours should be plotted in the graph. Default value is |
show_legend |
Logical. Indicates, whether legend should be displayed below the graph. Default value is |
label_sensors |
A logical value indicating whether the sensor labels should also be plotted (default value is |
The spline interpolation is done independently for each CI bound and average.
Note: When specifying the coords and template at the same time, the template parameter takes precedence and the coords parameter is ignored.
A ggplot object showing the static topographic map of the signal divided into three panels: CI lower, mean, CI upper.
animate_topo_mean: animated version of the plot; topo_plot
# Plot average topographic map with CI bounds of signal for subject 2 from the time point 10
# (the time of the stimulus) excluding outlier epochs 14 and 15
# a) preparing data
# a1) extract required data
edata <- epochdata |>
dplyr::filter(subject == 2 & time %in% 1:10 & epoch %in% 1:13)
# a2) baseline correction (needed for suitable topographic map)
data_base <- baseline_correction(edata, baseline_range = 1:10)
# a3) average computing
data_mean <- compute_mean(data_base, amplitude = "signal_base", subject = 2, time = 10,
type = "jack", group = "space")
# a4) prepare a mesh for plotting
M <- point_mesh(dimension = 2, n = 3000, template = "HCGSN256",
sensor_select = unique(epochdata$sensor))
# b) plot the topographic map with legend
plot_topo_mean(data = data_mean, mesh = M, template = "HCGSN256", show_legend = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.