ERP grid

Setup

Package loading

using Unfold
using UnfoldMakie
using CairoMakie
using UnfoldSim
include("../../../example_data.jl")
Main.example_data

Plot ERP grid

data, pos = TopoPlots.example_data()
data = data[:, :, 1]


f = Figure()
plot_erpgrid!(f[1, 1], data, pos; axis = (; xlabel = "s", ylabel = "µV"))
f
Example block output

Configurations for Channel image

UnfoldMakie.plot_erpgridFunction
plot_erpgrid!(f::Union{GridPosition, GridLayout, Figure}, data::Matrix{<:Real}, pos::Vector{Point{2,Float}}; kwargs...)
plot_erpgrid(data::Matrix{<:Real}, pos::Vector{Point{2,Float}}; kwargs...)

Plot an ERP image.

Arguments

  • f::Union{GridPosition, GridLayout, Figure}
    Figure, GridLayout, or GridPosition to draw the plot.
  • data::Matrix{<:Real}
    Data for the plot visualization.
  • pos::Vector{Point{2,Float}}
    Electrode positions.

Keyword argumets (kwargs)

  • drawlabels::Bool = false
    Draw channels labels over each waveform.
  • times::Vector = 1:size(data, 2)
    Vector of size().

Shared plot configuration options

The shared plot options can be used as follows: type = (; key = value, ...)).
For example, plot_x(...; layout = (; show_legend = true, legend_position = :right)).
Multiple defaults will be cycled until match.

Placing ; is important!

figure = NamedTuple() - use kwargs... of Makie.Figure

axis = (xlabel = "Time [s]", ylabel = "Voltage [µV]", xlim = [-0.04, 1.0], ylim = [-0.04, 1.0]) - use kwargs... of Makie.Axis

layout = (show_legend = true, legend_position = :right, xlabelFromMapping = :x, ylabelFromMapping = :y, use_colorbar = false)

mapping = (x = (:time,), y = (:estimate, :yhat, :y))

visual = (colormap = :roma,) - use kwargs... of Makie.lines

legend = (orientation = :vertical, tellwidth = true, tellheight = false) - use kwargs... of Makie.Legend

colorbar = (vertical = true, tellwidth = true, tellheight = false) - use kwargs... of Makie.Colorbar

Return Value: Figure displaying ERP grid.

source

This page was generated using Literate.jl.