Skip to content

Plotting Functions

All public plotting functions in EegFun.jl.

Index

Functions

EegFun.plot_artifact_components Method
julia
plot_artifact_components(ica::InfoIca, artifacts::ArtifactComponents; kwargs...)

Plot topoplots for all artifact components organized by type (vEOG, hEOG, ECG, Line Noise, Channel Noise).

This is a convenience function that takes the output of combine_artifact_components and creates a comprehensive visualization showing all identified artifact components with clear labels.

Arguments

  • ica::InfoIca: The ICA result object

  • artifacts::ArtifactComponents: The artifact components structure from combine_artifact_components

Keyword Arguments

All keyword arguments from plot_topography are supported, including:

  • method::Symbol: Interpolation method (see plot_topography for supported methods)

  • gridscale::Int: Grid resolution for interpolation

  • colormap: Colormap for the topography

  • display_plot::Bool: Whether to display the plot

Returns

  • Figure: The Makie Figure containing all topoplots

Examples

julia
# Identify artifact components
eog_comps, _ = identify_eog_components(dat, ica)
ecg_comps, _ = identify_ecg_components(dat, ica)
line_noise_comps, _ = identify_line_noise_components(dat, ica)
channel_noise_comps, _ = identify_spatial_kurtosis_components(ica)

# Combine them
artifacts = combine_artifact_components(eog_comps, ecg_comps, line_noise_comps, channel_noise_comps)

# Plot all artifact components
fig = plot_artifact_components(ica, artifacts)
source
EegFun.plot_artifact_detection Method
julia
plot_artifact_detection(epochs::EpochData, artifacts::EpochRejectionInfo; channel_selection::Function=channels(), kwargs...)

Interactive plot of artifact detection results with Previous/Next buttons for epoch navigation.

Arguments

  • epochs::EpochData: The epoch data

  • artifacts::EpochRejectionInfo: Artifact detection results

  • channel_selection::Function: Channel predicate for selecting channels to plot (default: all layout channels)

Keyword Arguments

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • display_plot::Bool=true: Display plot.

  • ygrid::Bool=false: Whether to show y-axis grid

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple or nothing for auto-scaling

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple or nothing for auto-scaling

  • alpha_normal::Float64=0.2: Transparency for normal channels.

  • colormap_name::Symbol=jet: Colormap name (e.g., :Set1_9, :tab20).

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • linewidth_rejected::Int64=2: Line width for rejected channels.

  • alpha_rejected::Float64=1.0: Transparency for rejected channels.

  • selection_threshold::Int64=50: Distance threshold for channel selection.

  • xgrid::Bool=false: Whether to show x-axis grid

  • linewidth_normal::Int64=1: Line width for normal channels.

  • add_xy_origin::Bool=true: Whether to add origin lines at x=0 and y=0

Returns

  • Figure: Interactive Makie figure with navigation buttons

Examples

julia
# Basic interactive plot
fig = plot_artifact_detection(epochs, artifacts)

# With specific channels
fig = plot_artifact_detection(epochs, artifacts, 
                            channel_selection = channels([:Fp1, :Fp2, :Cz]))

# With custom axis limits
fig = plot_artifact_detection(epochs, artifacts, xlim = (-0.2, 0.8), ylim = (-100, 100))
source
EegFun.plot_artifact_rejection Method
julia
plot_artifact_rejection(epochs_original::EpochData, epochs_rejected::EpochData, artifacts::EpochRejectionInfo; channel_selection::Function=channels(), kwargs...)

Interactive plot comparison between original and rejected epochs with navigation buttons. Epochs are aligned by epoch number from the dataframe. If an epoch was rejected (doesn't exist in epochs_rejected), both plots show a blank plot with red spines.

Arguments

  • epochs_original::EpochData: Original epoch data (before rejection)

  • epochs_rejected::EpochData: Epoch data after rejection (may have fewer epochs)

  • artifacts::EpochRejectionInfo: Artifact detection results

  • channel_selection::Function: Channel predicate for selecting channels to plot (default: all layout channels)

Keyword Arguments

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • display_plot::Bool=true: Display plot.

  • ygrid::Bool=false: Whether to show y-axis grid

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple or nothing for auto-scaling

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple or nothing for auto-scaling

  • alpha_normal::Float64=0.2: Transparency for normal channels.

  • colormap_name::Symbol=jet: Colormap name (e.g., :Set1_9, :tab20).

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • linewidth_rejected::Int64=2: Line width for rejected channels.

  • alpha_rejected::Float64=1.0: Transparency for rejected channels.

  • selection_threshold::Int64=50: Distance threshold for channel selection.

  • xgrid::Bool=false: Whether to show x-axis grid

  • linewidth_normal::Int64=1: Line width for normal channels.

  • add_xy_origin::Bool=true: Whether to add origin lines at x=0 and y=0

Returns

  • Figure: Interactive Makie figure with navigation buttons showing before/after comparison

Examples

julia
# Basic interactive rejection comparison
fig = plot_artifact_rejection(epochs_orig, epochs_rejected, artifacts)

# With specific channels
fig = plot_artifact_rejection(epochs_orig, epochs_rejected, artifacts,
                            channel_selection = channels([:Fp1, :Fp2, :Cz]))

# With custom axis limits
fig = plot_artifact_rejection(epochs_orig, epochs_rejected, artifacts, xlim = (-0.2, 0.8), ylim = (-100, 100))
source
EegFun.plot_artifact_repair Method
julia
plot_artifact_repair(epochs_original::EpochData, epochs_repaired::EpochData, artifacts::EpochRejectionInfo; channel_selection::Function=channels(), kwargs...)

Interactive plot comparison between original and repaired epochs with navigation buttons.

Arguments

  • epochs_original::EpochData: Original epoch data

  • epochs_repaired::EpochData: Repaired epoch data

  • artifacts::EpochRejectionInfo: Artifact detection results

  • channel_selection::Function: Channel predicate for selecting channels to plot (default: all layout channels)

Keyword Arguments

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • display_plot::Bool=true: Display plot.

  • ygrid::Bool=false: Whether to show y-axis grid

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple or nothing for auto-scaling

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple or nothing for auto-scaling

  • alpha_normal::Float64=0.2: Transparency for normal channels.

  • colormap_name::Symbol=jet: Colormap name (e.g., :Set1_9, :tab20).

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • linewidth_rejected::Int64=2: Line width for rejected channels.

  • alpha_rejected::Float64=1.0: Transparency for rejected channels.

  • selection_threshold::Int64=50: Distance threshold for channel selection.

  • xgrid::Bool=false: Whether to show x-axis grid

  • linewidth_normal::Int64=1: Line width for normal channels.

  • add_xy_origin::Bool=true: Whether to add origin lines at x=0 and y=0

Returns

  • Figure: Interactive Makie figure with navigation buttons showing before/after comparison

Examples

julia
# Basic interactive repair comparison
fig = plot_artifact_repair(epochs_orig, epochs_repaired, artifacts)

# With specific channels
fig = plot_artifact_repair(epochs_orig, epochs_repaired, artifacts,
                          channel_selection = channels([:Fp1, :Fp2, :Cz]))

# With custom axis limits
fig = plot_artifact_repair(epochs_orig, epochs_repaired, artifacts, xlim = (-0.2, 0.8), ylim = (-100, 100))
source
EegFun.plot_channel_summary! Method
julia
plot_channel_summary!(fig::Figure, ax::Axis, dat::DataFrame, col::Symbol; kwargs...)
plot_channel_summary(dat::DataFrame, col::Symbol; kwargs...)

Plot a bar chart summarizing a specific metric per channel from a DataFrame.

Assumes the DataFrame dat contains at least two columns:

  • :channel: Containing channel names or identifiers (will be used for x-axis labels).

  • col: The column specified by the col argument, containing the values to plot.

julia
plot_channel_summary!(fig, ax, dat, col; kwargs...)

Arguments

  • fig::Figure: The Makie Figure object to plot on (mutating version only)

  • ax::Axis: The Makie Axis object to plot on (mutating version only)

  • dat::DataFrame: DataFrame containing channel summary data.

  • col::Symbol: The symbol representing the column in dat to plot on the y-axis.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • title_fontsize::Int64=16: Font size for title.

  • tick_fontsize::Int64=12: Font size for tick labels.

  • error_linewidth::Int64=2: Error bar linewidth.

  • display_plot::Bool=true: Display plot.

  • xtick_rotation::Float64=0.7853981633974483: Rotation angle for x-axis tick labels.

  • dims::Nothing=nothing: Tuple (rows, cols) for grid layout. default = _best_rect(n_columns).

  • ygrid::Bool=false: Whether to show y-axis grid

  • bar_width::Float64=0.8: Bar width.

  • bar_alpha::Float64=0.7: Bar alpha.

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • xlabel::String=Electrode: x-axis label.

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • label_fontsize::Int64=14: Font size for axis labels.

  • ylabel::String=: y-axis label

  • xgrid::Bool=false: Whether to show x-axis grid

  • title::String=: Plot title.

  • sort_values::Bool=false: Sort the bars by the values in the col column in descending order.

  • average_over::Nothing=nothing: Column to average over (e.g., :epoch). If specified, will compute mean ± 95% CI.

  • bar_color::Symbol=steelblue: Bar color.

  • error_color::Symbol=black: Error bar color.

Returns

  • Mutating version: nothing (modifies the provided figure and axis in-place)

  • Non-mutating version: (fig::Figure, ax::Axis) - The created figure and axis objects

Examples

julia
# Non-mutating version (creates new figure)
fig, ax = plot_channel_summary(summary_df, :kurtosis)

# Mutating version (plots on existing figure)
fig = Figure()
ax = Axis(fig[1, 1])
plot_channel_summary!(fig, ax, summary_df, :kurtosis)

# Customize appearance
fig, ax = plot_channel_summary(summary_df, :kurtosis, 
    bar_color = :red, 
    title = "Custom Title",
    sort_values = true)

# With averaging and error bars
fig, ax = plot_channel_summary(summary_df, :kurtosis,
    average_over = :epoch,
    error_color = :blue,
    error_linewidth = 3)
source
EegFun.plot_channel_summary Method
julia
plot_channel_summary(dat::DataFrame, col::Symbol; kwargs...)

Plot a bar chart summarizing a specific metric per channel. Creates a new figure.

See plot_channel_summary! for full documentation of arguments and keyword arguments.

Returns

  • (fig::Figure, ax::Axis) - The created figure and axis objects
source
EegFun.plot_confusion_matrix Method
julia
plot_confusion_matrix(decoded::DecodedData; time_point::Union{Float64, Int, Nothing} = nothing, kwargs...)

Plot confusion matrix for decoding results.

Arguments

  • decoded::DecodedData: DecodedData object containing confusion matrices

  • time_point::Union{Float64, Int, Nothing}: Time point to plot (in seconds or index). If nothing, plots average across all time points

  • kwargs: Additional keyword arguments

Examples

julia
# Plot confusion matrix at a specific time point
plot_confusion_matrix(decoded, time_point=0.3)

# Plot average confusion matrix
plot_confusion_matrix(decoded)
source
EegFun.plot_correlation_heatmap! Method
julia
plot_correlation_heatmap!(fig::Figure, ax::Axis, corr_df::DataFrame; kwargs...)

Plot a heatmap of a correlation matrix stored in a DataFrame on the provided figure and axis.

This is the mutating version that plots directly on the provided fig and ax objects.

Arguments

  • fig::Figure: The Makie Figure object to plot on

  • ax::Axis: The Makie Axis object to plot on

  • corr_df::DataFrame: DataFrame containing the correlation matrix. First column for row labels, rest for correlation values.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Position of the colorbar as (row, col) tuple

  • colormap::Symbol=jet: Colormap for the heatmap

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • colorbar_fontsize::Int64=12: Font size for colorbar label

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • label_fontsize::Int64=14: Font size for axis labels

  • ylabel::String=: Label for y-axis

  • title::String=: Plot title

  • colorbar_label::String=Correlation: Label for the colorbar

  • nan_color::Symbol=transparent: Color for NaN values

  • display_plot::Bool=true: Whether to display the plot

  • ygrid::Bool=false: Whether to show y-axis grid

  • colorbar_width::Int64=30: Width of the colorbar

  • xlabel::String=: Label for x-axis

  • colorrange::Tuple{Int64, Int64}=(-1, 1): Color range for the heatmap and colorbar (should be -1 to 1 for correlations)

  • show_title::Bool=true: Whether to show the title

  • mask_range::Nothing=nothing: Optional tuple (min_val, max_val) to mask correlations within this range

  • ytick_rotation::Int64=0: Rotation angle for y-axis tick labels

  • xgrid::Bool=false: Whether to show x-axis grid

  • colorbar_plot::Bool=true: Whether to display the colorbar

  • title_fontsize::Int64=16: Font size for the title

  • xtick_rotation::Float64=0.7853981633974483: Rotation angle for x-axis tick labels

  • tick_fontsize::Int64=12: Font size for tick labels

Returns

  • Mutating version: nothing (modifies the provided figure and axis in-place)

  • Non-mutating version: (fig::Figure, ax::Axis) - The created figure and axis objects

Examples

julia
# Generate sample correlation data
labels = ["Ch1", "Ch2", "Ch3", "Ch4"]
matrix = cor(rand(100, 4))
corr_df = DataFrame(matrix, labels)
insertcols!(corr_df, 1, :row => labels) # Add row label column

# Non-mutating version (creates new figure)
fig, ax = plot_correlation_heatmap(corr_df)

# Mutating version (plots on existing figure)
fig = Figure()
ax = Axis(fig[1, 1])
plot_correlation_heatmap!(fig, ax, corr_df)

# Customize appearance
fig, ax = plot_correlation_heatmap(corr_df; 
    mask_range = (-0.3, 0.3),
    colormap = :plasma,
    colorbar_label = "Custom Label")
source
EegFun.plot_correlation_heatmap Method
julia
plot_correlation_heatmap(corr_df::DataFrame; kwargs...)

Plot a heatmap of a correlation matrix. Creates a new figure.

See plot_correlation_heatmap! for full documentation of arguments and keyword arguments.

Returns

  • (fig::Figure, ax::Axis) - The created figure and axis objects
source
EegFun.plot_databrowser Function

Launch the interactive data browser for a single EEG dataset.

source
EegFun.plot_databrowser Function

Load data from a .jld2 file or pattern and open the data browser.

source
EegFun.plot_databrowser Function

Open a separate data browser window for each dataset in the vector.

source
EegFun.plot_decoding Method
julia
plot_decoding(decoded::DecodedData; kwargs...)

Plot decoding accuracy over time.

Creates a line plot showing classification accuracy at each time point, with optional error bars and chance level reference line.

Arguments

  • decoded::DecodedData: DecodedData object containing decoding results

  • kwargs: Additional keyword arguments (see PLOT_DECODING_KWARGS)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • chance_linestyle::Symbol=dash: Line style for chance level

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple. If nothing, automatically determined

  • sig_alpha::Float64=0.5: Transparency for significance markers

  • ylabel::String=Classification Accuracy: Label for y-axis

  • linestyle::Symbol=solid: Line style

  • figure_title::String=Decoding Results: Title for the plot window

  • title::String=: Plot title

  • figure_padding::NTuple{4, Int64}=(10, 10, 10, 10): Padding around entire figure as (left, right, top, bottom) tuple (in pixels)

  • display_plot::Bool=true: Display the plot (true/false)

  • interactive::Bool=true: Enable interactive features (true/false)

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple. If nothing, automatically determined

  • ygrid::Bool=true: Show y-axis grid (true/false)

  • xlabel::String=Time (s): Label for x-axis

  • sig_color::Symbol=black: Color for significance markers

  • error_alpha::Float64=0.3: Transparency for error shading

  • color::Symbol=blue: Color for decoding curve

  • show_title::Bool=true: Show title (true/false)

  • chance_linewidth::Int64=1: Line width for chance level

  • chance_color::Symbol=gray: Color for chance level line

  • show_error::Bool=true: Show standard error bars (true/false)

  • xgrid::Bool=true: Show x-axis grid (true/false)

  • add_xy_origin::Bool=true: Add origin lines at x=0 and y=chance (true/false)

  • linewidth::Int64=2: Line width for decoding curve

  • error_color::Symbol=blue: Color for error bars

Examples

julia
# Basic plot
plot_decoding(decoded)

# Custom styling
plot_decoding(decoded, color=:red, linewidth=3, show_error=false)

# With custom title
plot_decoding(decoded, title="Face vs. Object Decoding")
julia
plot_decoding(filepath::String; input_dir=pwd(), participant_selection=participants(), kwargs...)

Load decoded data and plot. Accepts either a .jld2 filepath or a pattern to discover and plot all matching files (one plot per file).

Examples

julia
plot_decoding("decoded.jld2")
plot_decoding("decoded")
source
EegFun.plot_ecg_component_features Method
julia
plot_ecg_component_features(identified_comps::Vector{Int64}, metrics_df::DataFrame)

Create a simplified visualization of ECG component detection metrics.

Arguments

  • identified_comps::Vector{Int64}: Vector of component indices identified as ECG artifacts

  • metrics_df::DataFrame: DataFrame with component metrics

Returns

  • fig::Figure: The Makie Figure containing the plot
source
EegFun.plot_eog_component_features Method
julia
plot_eog_component_features(identified_comps::Dict, metrics_df::DataFrame; kwargs...)

Plot z-scores of EOG correlations from the metrics DataFrame and highlight identified components.

Uses the results from identify_eye_components.

Arguments

  • identified_comps::Dict: Dictionary returned by identify_eye_components (containing :vEOG, :hEOG).

  • metrics_df::DataFrame: DataFrame returned by identify_eye_components. Expected to have columns :vEOG_zscore, :hEOG_zscore, and :Component.

Keyword Arguments

  • z_threshold::Float64: Z-score threshold to draw lines on the plot (default: 3.0).

  • display_plot::Bool: Whether to display the plot (default: true).

Returns

  • Named tuple (fig, axes) where axes = (ax_v, ax_h).
source
EegFun.plot_epochs Method
julia
plot_epochs(filename::String; 
           input_dir::String = pwd(),
           participant_selection::Function = participants(),
           channel_selection::Function = channels(),
           sample_selection::Function = samples(),
interval_selection::Interval = times(), 
           epoch_selection::Function = epochs(),
           include_extra::Bool = false,
           layout = :single,
           kwargs...)

Load epoch data and create plots. Accepts either a direct .jld2 filepath or a pattern string to discover and plot all matching files (one plot per file).

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • legend_imagecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend imagecolorrange parameter

  • legend_meshscattercolor::Observables.Observable{Any}=Observable{Any}(:black): Legend meshscattercolor parameter

  • layout_topo_plot_height::Float64=0.1: Height of individual plots (fraction of figure height)

  • legend_framewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Legend framewidth parameter

  • legend_linewidth::Observables.Observable{Any}=Observable{Any}(1.5): Legend linewidth parameter

  • legend_markercolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend markercolormap parameter

  • legend_surfacecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend surfacecolorrange parameter

  • legend_patchstrokewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Legend patchstrokewidth parameter

  • legend_titleposition::Observables.Observable{Any}=Observable{Any}(:top): Legend titleposition parameter

  • layout_topo_plot_width::Float64=0.1: Width of individual plots (fraction of figure width)

  • plot_avg_trials::Bool=true: Whether to draw ERP average overlay

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple. If nothing, automatically determined

  • legend_patchstrokecolor::Observables.Observable{Any}=Observable{Any}(:transparent): Legend patchstrokecolor parameter

  • legend_markerstrokecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend markerstrokecolor parameter

  • legend_meshscattersize::Observables.Observable{Any}=Observable{Any}(0.8): Legend meshscattersize parameter

  • xgrid::Bool=false: Whether to show x-axis grid

  • layout_grid_skip_positions::Nothing=nothing: Positions to skip in grid layout as vector of (row, col) tuples, e.g., [(2,1), (2,3)]

  • legend_patchsize::Observables.Observable{Any}=Observable{Any}((20.0f0, 20.0f0)): Legend patchsize parameter

  • avg_linewidth_multiplier::Float64=2.0: Multiplier for average line width.

  • legend_framecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend framecolor parameter

  • legend_titlehalign::Observables.Observable{Any}=Observable{Any}(:center): Legend titlehalign parameter

  • legend_bgcolor::Observables.Observable{Any}=Observable{Any}(nothing): Legend bgcolor parameter

  • trial_alpha::Float64=0.25: Alpha (transparency) for individual trial traces

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple. If nothing, automatically determined

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • legend_position::Symbol=lt: Position of the legend for axislegend() (symbol like :lt, :rt, :lb, :rb, or tuple like (:left, :top), or (0.5, 0.5))

  • layout_topo_margin::Float64=0.12: Margin between plots

  • legend_labelsize::Observables.Observable{Any}=Observable{Any}(14): Legend labelsize parameter

  • legend_colgap::Observables.Observable{Any}=Observable{Any}(16): Legend colgap parameter

  • legend_labelvalign::Observables.Observable{Any}=Observable{Any}(:center): Legend labelvalign parameter

  • legend_halign::Observables.Observable{Any}=Observable{Any}(:right): Legend halign parameter

  • title::Nothing=nothing: Plot title. If nothing, automatically determined

  • legend_backgroundcolor::Observables.Observable{Any}=Observable{Any}(:white): Legend backgroundcolor parameter

  • legend_alpha::Observables.Observable{Any}=Observable{Any}(1): Legend alpha parameter

  • legend_titlevalign::Observables.Observable{Any}=Observable{Any}(:center): Legend titlevalign parameter

  • yreversed::Bool=false: Whether to reverse the y-axis

  • legend_markercolor::Observables.Observable{Any}=Observable{Any}(:black): Legend markercolor parameter

  • legend_labels::Vector{Any}=Any[]: If plotting multiple plots, custom labels for conditions.

  • legend_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Legend height parameter

  • legend_surfacedata::Observables.Observable{Any}=Observable{Any}((-0.7 .. 0.7, -0.7 .. 0.7, [-0.21875 0.17499999999999996 0.48125000000000007 0.7000000000000001 0.8312499999999999 0.875 0.8312499999999999 0.7000000000000001 0.48125000000000007 0.17499999999999996 -0.21875; -0.112 0.08959999999999999 0.24640000000000004 0.35840000000000005 0.4256 0.448 0.4256 0.35840000000000005 0.24640000000000004 0.08959999999999999 -0.112; -0.04725 0.03779999999999999 0.10395000000000001 0.1512 0.17955 0.189 0.17955 0.1512 0.10395000000000001 0.03779999999999999 -0.04725; -0.014 0.011199999999999998 0.030800000000000004 0.044800000000000006 0.0532 0.056 0.0532 0.044800000000000006 0.030800000000000004 0.011199999999999998 -0.014; -0.00175 0.0013999999999999998 0.0038500000000000006 0.005600000000000001 0.00665 0.007 0.00665 0.005600000000000001 0.0038500000000000006 0.0013999999999999998 -0.00175; 0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 0.0; 0.00175 -0.0013999999999999998 -0.0038500000000000006 -0.005600000000000001 -0.00665 -0.007 -0.00665 -0.005600000000000001 -0.0038500000000000006 -0.0013999999999999998 0.00175; 0.014 -0.011199999999999998 -0.030800000000000004 -0.044800000000000006 -0.0532 -0.056 -0.0532 -0.044800000000000006 -0.030800000000000004 -0.011199999999999998 0.014; 0.04725 -0.03779999999999999 -0.10395000000000001 -0.1512 -0.17955 -0.189 -0.17955 -0.1512 -0.10395000000000001 -0.03779999999999999 0.04725; 0.112 -0.08959999999999999 -0.24640000000000004 -0.35840000000000005 -0.4256 -0.448 -0.4256 -0.35840000000000005 -0.24640000000000004 -0.08959999999999999 0.112; 0.21875 -0.17499999999999996 -0.48125000000000007 -0.7000000000000001 -0.8312499999999999 -0.875 -0.8312499999999999 -0.7000000000000001 -0.48125000000000007 -0.17499999999999996 0.21875])): Legend surfacedata parameter

  • ygrid::Bool=false: Whether to show y-axis grid

  • layout_grid_colgap::Int64=10: Gap between columns (in pixels)

  • legend_linecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend linecolorrange parameter

  • legend_heatmaplimits::Observables.Observable{Any}=Observable{Any}((0 .. 1, 0 .. 1)): Legend heatmaplimits parameter

  • legend_meshscatterrotation::Observables.Observable{Any}=Observable{Any}(1.0 + 0.0im + 0.0jm + 0.0km): Legend meshscatterrotation parameter

  • legend_heatmapvalues::Observables.Observable{Any}=Observable{Any}([0.0 0.3; 0.6 1.0]): Legend heatmapvalues parameter

  • legend_tellheight::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend tellheight parameter

  • color::Symbol=black: Color for epoch traces (can be a single color or a vector of colors, one per condition)

  • legend_margin::Observables.Observable{Any}=Observable{Any}((6, 6, 6, 6)): Legend margin parameter

  • legend_polypoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]): Legend polypoints parameter

  • legend_channel::Vector{Any}=Any[]: If plotting multiple plots, within channel to put the legend on.

  • legend_imagevalues::Observables.Observable{Any}=Observable{Any}([0.0 0.3; 0.6 1.0]): Legend imagevalues parameter

  • layout_grid_rowgap::Int64=10: Gap between rows (in pixels)

  • legend_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Legend labelfont parameter

  • legend_orientation::Observables.Observable{Any}=Observable{Any}(:vertical): Legend orientation parameter

  • linewidth::Int64=1: Line width for epoch traces

  • legend_polycolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.4, 0.4, 0.4)): Legend polycolor parameter

  • layout_grid_dims::Nothing=nothing: Grid dimensions as (rows, cols) tuple for grid layouts. If nothing, automatically determined

  • legend_linepoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.0, 0.5], [1.0, 0.5]]): Legend linepoints parameter

  • legend_surfacecolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend surfacecolormap parameter

  • legend_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Legend alignmode parameter

  • colormap::Symbol=jet: Colormap for multi-condition plots

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • legend_heatmapcolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend heatmapcolorrange parameter

  • legend_meshcolor::Observables.Observable{Any}=Observable{Any}(RGBA{Float32}(0.0, 0.44705883, 0.69803923, 1.0)): Legend meshcolor parameter

  • legend_label::String=: Title for the legend

  • legend_titlesize::Observables.Observable{Any}=Observable{Any}(14): Legend titlesize parameter

  • legend_patchcolor::Observables.Observable{Any}=Observable{Any}(:transparent): Legend patchcolor parameter

  • ylabel::String=μV: Label for y-axis

  • legend_framevisible::Bool=true: Whether to show the frame of the legend

  • legend_polycolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend polycolorrange parameter

  • legend_groupgap::Observables.Observable{Any}=Observable{Any}(16): Legend groupgap parameter

  • display_plot::Bool=true: Whether to display the plot

  • average_channels::Bool=false: Whether to average across channels

  • layout_topo_show_scale::Bool=false: Whether to show a scale axis in topo layout

  • interactive::Bool=true: Whether to enable interactive features

  • legend_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Legend labelcolor parameter

  • legend_meshcolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend meshcolorrange parameter

  • legend::Bool=true: Whether to show the legend

  • xlabel::String=Time (s): Label for x-axis

  • legend_polystrokecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend polystrokecolor parameter

  • legend_linestyle::Observables.Observable{Any}=Observable{Any}(:solid): Legend linestyle parameter

  • legend_meshscattermarker::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Sphere{Float32}(Float32[0.0, 0.0, 0.0], 1.0f0)): Legend meshscattermarker parameter

  • legend_mesh::Observables.Observable{Any}=Observable{Any}(GeometryBasics.HyperRectangle{3, Float32}(Float32[-0.7, -0.7, -0.7], Float32[1.4, 1.4, 1.4])): Legend mesh parameter

  • legend_linecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend linecolor parameter

  • legend_meshcolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend meshcolormap parameter

  • legend_meshscatterpoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{3, Float32}[[0.0, 0.0, 0.0]]): Legend meshscatterpoints parameter

  • legend_nbanks::Nothing=nothing: Number of columns for the legend. If nothing, automatically determined.

  • add_xy_origin::Bool=true: Whether to add origin lines at x=0 and y=0

  • legend_labelhalign::Observables.Observable{Any}=Observable{Any}(:left): Legend labelhalign parameter

  • legend_polycolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend polycolormap parameter

  • legend_rowgap::Observables.Observable{Any}=Observable{Any}(3): Legend rowgap parameter

  • legend_gridsvalign::Observables.Observable{Any}=Observable{Any}(:center): Legend gridsvalign parameter

  • legend_valign::Observables.Observable{Any}=Observable{Any}(:top): Legend valign parameter

  • legend_surfacevalues::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend surfacevalues parameter

  • layout_topo_scale_pos::Tuple{Float64, Float64}=(0.0, 0.0): Fallback position for scale plot in topo layout as (x, y) tuple

  • legend_markerstrokewidth::Observables.Observable{Any}=Observable{Any}(0): Legend markerstrokewidth parameter

  • legend_marker::Observables.Observable{Any}=Observable{Any}(:circle): Legend marker parameter

  • legend_meshscattercolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend meshscattercolormap parameter

  • legend_polystrokewidth::Observables.Observable{Any}=Observable{Any}(0): Legend polystrokewidth parameter

  • theme_fontsize::Int64=24: Font size for theme

  • legend_labeljustification::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend labeljustification parameter

  • figure_padding::NTuple{4, Int64}=(10, 10, 10, 10): Padding around entire figure as (left, right, top, bottom) tuple (in pixels)

  • legend_tellwidth::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend tellwidth parameter

  • legend_patchlabelgap::Observables.Observable{Any}=Observable{Any}(5): Legend patchlabelgap parameter

  • legend_markersize::Observables.Observable{Any}=Observable{Any}(9): Legend markersize parameter

  • legend_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Legend width parameter

  • legend_titlecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend titlecolor parameter

  • legend_imagelimits::Observables.Observable{Any}=Observable{Any}((0 .. 1, 0 .. 1)): Legend imagelimits parameter

  • legend_linecolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend linecolormap parameter

  • legend_padding::Observables.Observable{Any}=Observable{Any}((6.0f0, 6.0f0, 6.0f0, 6.0f0)): Legend padding parameter

  • legend_meshscattercolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend meshscattercolorrange parameter

  • layout::Symbol=single: Layout type: :single, :grid, or :topo

  • legend_markercolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend markercolorrange parameter

  • legend_gridshalign::Observables.Observable{Any}=Observable{Any}(:center): Legend gridshalign parameter

  • legend_titlevisible::Observables.Observable{Any}=Observable{Any}(true): Legend titlevisible parameter

  • legend_titlegap::Observables.Observable{Any}=Observable{Any}(8): Legend titlegap parameter

  • legend_markerpoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.5, 0.5]]): Legend markerpoints parameter

  • legend_titlefont::Observables.Observable{Any}=Observable{Any}(:bold): Legend titlefont parameter

Examples

julia
plot_epochs("epochs_original.jld2")
plot_epochs("epochs_original")
plot_epochs("epochs_original", participant_selection = participants(1))
source
EegFun.plot_erp! Method
julia
plot_erp!(fig::Figure, ax::Axis, dat::ErpData; kwargs...)

Plot ERP data on an existing axis, mutating the figure and axis.

Arguments

  • fig::Figure: The figure to plot on

  • ax::Axis: The axis to plot on

  • dat::ErpData: The ERP data to plot

  • kwargs...: Additional plotting arguments (see PLOT_ERP_KWARGS)

Returns

  • ax::Axis: The axis that was plotted on
source
EegFun.plot_erp Method
julia
plot_erp(filepath::String; 
         input_dir::String = pwd(),
         participant_selection::Function = participants(),
         layout::Union{Symbol, PlotLayout} = :single,
         condition_selection::Function = conditions(),
         channel_selection::Function = channels(),
         channel_plot_order::Union{Nothing, Vector{Symbol}} = nothing,
         sample_selection::Function = samples(),
         interval_selection::Interval = times(),
         baseline_interval::Interval = times(),
         kwargs...)

Load ERP data and create plots. Accepts either a direct .jld2 filepath or a filename pattern to discover and plot all matching files.

Arguments

  • filepath::String: Either a .jld2 file path, or a pattern string (e.g. "erps_good") to match against files in input_dir

  • input_dir::String: Directory to search for pattern-matched files (default: pwd())

  • participant_selection::Function: Participant filter for pattern mode (default: participants())

  • layout: Layout specification (see main plot_erp documentation)

  • channel_selection::Function: Function that returns boolean vector for channel filtering

  • sample_selection::Function: Function that returns boolean vector for sample filtering

  • kwargs: Additional keyword arguments

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • legend_imagecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend imagecolorrange parameter

  • legend_meshscattercolor::Observables.Observable{Any}=Observable{Any}(:black): Legend meshscattercolor parameter

  • layout_topo_plot_height::Float64=0.05: Height of individual plots (fraction of figure height)

  • legend_framewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Legend framewidth parameter

  • legend_linewidth::Observables.Observable{Any}=Observable{Any}(1.5): Legend linewidth parameter

  • legend_markercolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend markercolormap parameter

  • legend_surfacecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend surfacecolorrange parameter

  • legend_patchstrokewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Legend patchstrokewidth parameter

  • legend_titleposition::Observables.Observable{Any}=Observable{Any}(:top): Legend titleposition parameter

  • layout_topo_plot_width::Float64=0.05: Width of individual plots (fraction of figure width)

  • legend_patchstrokecolor::Observables.Observable{Any}=Observable{Any}(:transparent): Legend patchstrokecolor parameter

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple. If nothing, automatically determined

  • legend_markerstrokecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend markerstrokecolor parameter

  • xticks::Nothing=nothing: X-axis tick positions (e.g., -0.1:0.1:0.8 or [0, 0.2, 0.4]). If nothing, automatically determined

  • show_title::Bool=true: Show title (true/false)

  • legend_meshscattersize::Observables.Observable{Any}=Observable{Any}(0.8): Legend meshscattersize parameter

  • xgrid::Bool=false: Show x-axis grid (true/false)

  • layout_grid_skip_positions::Nothing=nothing: Positions to skip in grid layout as vector of (row, col) tuples, e.g., [(2,1), (2,3)]

  • legend_patchsize::Observables.Observable{Any}=Observable{Any}((20.0f0, 20.0f0)): Legend patchsize parameter

  • legend_framecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend framecolor parameter

  • legend_titlehalign::Observables.Observable{Any}=Observable{Any}(:center): Legend titlehalign parameter

  • legend_bgcolor::Observables.Observable{Any}=Observable{Any}(nothing): Legend bgcolor parameter

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple. If nothing, automatically determined

  • xminorgrid::Bool=false: Show x-axis minor grid (true/false)

  • legend_position::Symbol=lt: Legend position (:lt, :rt, :lb, :rb, or tuple like (:left, :top), or (0.5, 0.5))

  • legend_labelsize::Observables.Observable{Any}=Observable{Any}(14): Legend labelsize parameter

  • linestyle::Symbol=solid: Line style for ERPs (single style or a vector of styles, one per dataset)

  • legend_colgap::Observables.Observable{Any}=Observable{Any}(16): Legend colgap parameter

  • legend_labelvalign::Observables.Observable{Any}=Observable{Any}(:center): Legend labelvalign parameter

  • legend_halign::Observables.Observable{Any}=Observable{Any}(:right): Legend halign parameter

  • figure_title::String=ERP Plot: Title for the plot window

  • title::String=: Plot title

  • legend_alpha::Observables.Observable{Any}=Observable{Any}(1): Legend alpha parameter

  • legend_titlevalign::Observables.Observable{Any}=Observable{Any}(:center): Legend titlevalign parameter

  • yreversed::Bool=false: Whether to reverse the y-axis

  • legend_backgroundcolor::Observables.Observable{Any}=Observable{Any}(:white): Legend backgroundcolor parameter

  • legend_markercolor::Observables.Observable{Any}=Observable{Any}(:black): Legend markercolor parameter

  • legend_labels::Vector{Any}=Any[]: Legend labels.

  • legend_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Legend height parameter

  • legend_surfacedata::Observables.Observable{Any}=Observable{Any}((-0.7 .. 0.7, -0.7 .. 0.7, [-0.21875 0.17499999999999996 0.48125000000000007 0.7000000000000001 0.8312499999999999 0.875 0.8312499999999999 0.7000000000000001 0.48125000000000007 0.17499999999999996 -0.21875; -0.112 0.08959999999999999 0.24640000000000004 0.35840000000000005 0.4256 0.448 0.4256 0.35840000000000005 0.24640000000000004 0.08959999999999999 -0.112; -0.04725 0.03779999999999999 0.10395000000000001 0.1512 0.17955 0.189 0.17955 0.1512 0.10395000000000001 0.03779999999999999 -0.04725; -0.014 0.011199999999999998 0.030800000000000004 0.044800000000000006 0.0532 0.056 0.0532 0.044800000000000006 0.030800000000000004 0.011199999999999998 -0.014; -0.00175 0.0013999999999999998 0.0038500000000000006 0.005600000000000001 0.00665 0.007 0.00665 0.005600000000000001 0.0038500000000000006 0.0013999999999999998 -0.00175; 0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 0.0; 0.00175 -0.0013999999999999998 -0.0038500000000000006 -0.005600000000000001 -0.00665 -0.007 -0.00665 -0.005600000000000001 -0.0038500000000000006 -0.0013999999999999998 0.00175; 0.014 -0.011199999999999998 -0.030800000000000004 -0.044800000000000006 -0.0532 -0.056 -0.0532 -0.044800000000000006 -0.030800000000000004 -0.011199999999999998 0.014; 0.04725 -0.03779999999999999 -0.10395000000000001 -0.1512 -0.17955 -0.189 -0.17955 -0.1512 -0.10395000000000001 -0.03779999999999999 0.04725; 0.112 -0.08959999999999999 -0.24640000000000004 -0.35840000000000005 -0.4256 -0.448 -0.4256 -0.35840000000000005 -0.24640000000000004 -0.08959999999999999 0.112; 0.21875 -0.17499999999999996 -0.48125000000000007 -0.7000000000000001 -0.8312499999999999 -0.875 -0.8312499999999999 -0.7000000000000001 -0.48125000000000007 -0.17499999999999996 0.21875])): Legend surfacedata parameter

  • ygrid::Bool=false: Show y-axis grid (true/false)

  • layout_grid_colgap::Int64=10: Gap between columns (in pixels)

  • legend_linecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend linecolorrange parameter

  • legend_heatmaplimits::Observables.Observable{Any}=Observable{Any}((0 .. 1, 0 .. 1)): Legend heatmaplimits parameter

  • legend_meshscatterrotation::Observables.Observable{Any}=Observable{Any}(1.0 + 0.0im + 0.0jm + 0.0km): Legend meshscatterrotation parameter

  • legend_heatmapvalues::Observables.Observable{Any}=Observable{Any}([0.0 0.3; 0.6 1.0]): Legend heatmapvalues parameter

  • legend_tellheight::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend tellheight parameter

  • color::Symbol=black: Color for ERPs (single color or a vector of colors, one per dataset)

  • legend_margin::Observables.Observable{Any}=Observable{Any}((6, 6, 6, 6)): Legend margin parameter

  • legend_polypoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]): Legend polypoints parameter

  • legend_channel::Vector{Any}=Any[]: Which channel to put the legend on.

  • legend_imagevalues::Observables.Observable{Any}=Observable{Any}([0.0 0.3; 0.6 1.0]): Legend imagevalues parameter

  • layout_grid_rowgap::Int64=10: Gap between rows (in pixels)

  • legend_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Legend labelfont parameter

  • legend_orientation::Observables.Observable{Any}=Observable{Any}(:vertical): Legend orientation parameter

  • linewidth::Int64=2: Line width for ERPs

  • layout_topo_scale_offset::Float64=0.1: Offset factor for scale plot position

  • legend_polycolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.4, 0.4, 0.4)): Legend polycolor parameter

  • legend_linepoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.0, 0.5], [1.0, 0.5]]): Legend linepoints parameter

  • layout_grid_dims::Nothing=nothing: Grid dimensions as (rows, cols) tuple for grid layouts. If nothing, automatically determined

  • legend_surfacecolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend surfacecolormap parameter

  • legend_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Legend alignmode parameter

  • colormap::Symbol=jet: Colormap for multi-channel plots

  • yminorgrid::Bool=false: Show y-axis minor grid (true/false)

  • time_unit::Symbol=s: Time unit for x-axis display (😒 or :ms). Only affects axis labels and tick formatting — all intervals remain in seconds.

  • legend_heatmapcolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend heatmapcolorrange parameter

  • legend_meshcolor::Observables.Observable{Any}=Observable{Any}(RGBA{Float32}(0.0, 0.44705883, 0.69803923, 1.0)): Legend meshcolor parameter

  • legend_label::String=: Title for the legend

  • legend_titlesize::Observables.Observable{Any}=Observable{Any}(14): Legend titlesize parameter

  • legend_patchcolor::Observables.Observable{Any}=Observable{Any}(:transparent): Legend patchcolor parameter

  • ylabel::String=μV: Label for y-axis

  • legend_framevisible::Bool=true: Legend frame visible (true/false)

  • legend_polycolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend polycolorrange parameter

  • legend_groupgap::Observables.Observable{Any}=Observable{Any}(16): Legend groupgap parameter

  • display_plot::Bool=true: Display the plot (true/false)

  • interactive::Bool=true: Enable interactive features (true/false)

  • average_channels::Bool=false: Average across channels (true/false)

  • legend_meshcolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend meshcolorrange parameter

  • legend_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Legend labelcolor parameter

  • legend::Bool=true: Show the legend (true/false)

  • xlabel::String=Time (s): Label for x-axis

  • legend_polystrokecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend polystrokecolor parameter

  • legend_linestyle::Observables.Observable{Any}=Observable{Any}(:solid): Legend linestyle parameter

  • legend_meshscattermarker::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Sphere{Float32}(Float32[0.0, 0.0, 0.0], 1.0f0)): Legend meshscattermarker parameter

  • legend_mesh::Observables.Observable{Any}=Observable{Any}(GeometryBasics.HyperRectangle{3, Float32}(Float32[-0.7, -0.7, -0.7], Float32[1.4, 1.4, 1.4])): Legend mesh parameter

  • legend_linecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend linecolor parameter

  • legend_meshcolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend meshcolormap parameter

  • highlight_regions::Nothing=nothing: Highlight regions as a NamedTuple or Vector of NamedTuples. Each region: (x1, x2, y1=-Inf, y2=Inf, color=:gray, alpha=0.3)

  • legend_meshscatterpoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{3, Float32}[[0.0, 0.0, 0.0]]): Legend meshscatterpoints parameter

  • legend_nbanks::Nothing=nothing: Number of legend columns.

  • add_xy_origin::Bool=true: Add origin lines at x=0 and y=0 (true/false)

  • legend_labelhalign::Observables.Observable{Any}=Observable{Any}(:left): Legend labelhalign parameter

  • legend_polycolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend polycolormap parameter

  • legend_rowgap::Observables.Observable{Any}=Observable{Any}(3): Legend rowgap parameter

  • legend_gridsvalign::Observables.Observable{Any}=Observable{Any}(:center): Legend gridsvalign parameter

  • legend_valign::Observables.Observable{Any}=Observable{Any}(:top): Legend valign parameter

  • legend_surfacevalues::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend surfacevalues parameter

  • layout_topo_scale_pos::Tuple{Float64, Float64}=(0.8, -0.8): Fallback position for scale plot in topo layout as (x, y) tuple

  • legend_markerstrokewidth::Observables.Observable{Any}=Observable{Any}(0): Legend markerstrokewidth parameter

  • legend_marker::Observables.Observable{Any}=Observable{Any}(:circle): Legend marker parameter

  • legend_meshscattercolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend meshscattercolormap parameter

  • legend_polystrokewidth::Observables.Observable{Any}=Observable{Any}(0): Legend polystrokewidth parameter

  • legend_labeljustification::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend labeljustification parameter

  • figure_padding::NTuple{4, Int64}=(10, 10, 10, 10): Padding around entire figure as (left, right, top, bottom) tuple (in pixels)

  • legend_tellwidth::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend tellwidth parameter

  • legend_patchlabelgap::Observables.Observable{Any}=Observable{Any}(5): Legend patchlabelgap parameter

  • legend_markersize::Observables.Observable{Any}=Observable{Any}(9): Legend markersize parameter

  • legend_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Legend width parameter

  • legend_titlecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend titlecolor parameter

  • legend_imagelimits::Observables.Observable{Any}=Observable{Any}((0 .. 1, 0 .. 1)): Legend imagelimits parameter

  • legend_linecolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend linecolormap parameter

  • legend_padding::Observables.Observable{Any}=Observable{Any}((6.0f0, 6.0f0, 6.0f0, 6.0f0)): Legend padding parameter

  • legend_meshscattercolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend meshscattercolorrange parameter

  • legend_markercolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend markercolorrange parameter

  • legend_gridshalign::Observables.Observable{Any}=Observable{Any}(:center): Legend gridshalign parameter

  • legend_titlevisible::Observables.Observable{Any}=Observable{Any}(true): Legend titlevisible parameter

  • legend_titlegap::Observables.Observable{Any}=Observable{Any}(8): Legend titlegap parameter

  • legend_markerpoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.5, 0.5]]): Legend markerpoints parameter

  • yticks::Nothing=nothing: Y-axis tick positions (e.g., -4:2:4 or [-2, 0, 2]). If nothing, automatically determined

  • legend_titlefont::Observables.Observable{Any}=Observable{Any}(:bold): Legend titlefont parameter

Examples

julia
# Load and plot from file
plot_erp("grand_average_erps_good.jld2")

# Plot all files matching pattern in current directory
plot_erp("erps_good")

# Plot specific participant
plot_erp("erps_good", participant_selection = participants(1))

# With channel selection
plot_erp("erps_good", channel_selection = channels([:PO7, :PO8]), layout = :grid)
source
EegFun.plot_erp_image Method
julia
plot_erp_image(dat::EpochData; 
               layout::Union{Symbol, PlotLayout} = :single,
               channel_selection::Function = channels(),
               channel_plot_order::Union{Nothing, Vector{Symbol}} = nothing,
               sample_selection::Function = samples(),
interval_selection::Interval = times(),
               kwargs...)

Plot ERP image for specified channels and samples with flexible layout options.

Arguments

  • dat::EpochData: Epoch data structure

  • layout: Layout specification:

    • :single (default): Single ERP image plot

    • :grid: Auto-calculated grid layout for multiple channels

    • :topo: Topographic layout based on channel positions

    • PlotLayout: Custom layout object

    • Vector{Int}: Custom grid dimensions [rows, cols]

  • channel_selection::Function: Function that returns boolean vector for channel filtering (default: channels() - all channels)

  • sample_selection::Function: Function that returns boolean vector for sample filtering (default: samples() - all samples)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Position of the colorbar as (row, col) tuple

  • layout_grid_dims::Nothing=nothing: Grid dimensions as (rows, cols) tuple for grid layouts. If nothing, automatically determined

  • colormap::Symbol=jet: Colormap for the image

  • yminorgrid::Bool=false: Show y-axis minor grid (true/false)

  • layout_topo_plot_height::Float64=0.07: Height of individual plots (fraction of figure height)

  • ylim::Nothing=nothing: Y-axis limits for ERP waveform as (min, max) tuple. If nothing, automatically determined

  • colorbar_plot_numbers::Vector{Any}=Any[]: Plot indices for which to show colorbars. Empty list shows colorbars for all plots.

  • layout_topo_scale_pos::Tuple{Float64, Float64}=(0.95, 0.05): Fallback position for scale plot in topo layout as (x, y) tuple

  • xminorgrid::Bool=false: Show x-axis minor grid (true/false)

  • ylabel::String=Epoch: Label for y-axis

  • figure_title::String=ERP Image Plot: Title for the plot window

  • title::String=: Plot title

  • plot_erp::Bool=true: Whether to plot ERP average overlay

  • yreversed::Bool=false: Whether to reverse the y-axis

  • colorbar_label::String=μV: Label for the colorbar

  • layout_topo_plot_width::Float64=0.07: Width of individual plots (fraction of figure width)

  • figure_padding::NTuple{4, Int64}=(10, 10, 10, 10): Padding around entire figure as (left, right, top, bottom) tuple (in pixels)

  • display_plot::Bool=true: Display the plot (true/false)

  • interactive::Bool=true: Enable interactive features (true/false)

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple. If nothing, automatically determined

  • interpolate::Bool=false: Whether to interpolate the heatmap pixels for smoother appearance

  • colorbar_width::Int64=30: Width of the colorbar in pixels

  • ygrid::Bool=false: Show y-axis grid (true/false)

  • layout_grid_colgap::Int64=10: Gap between columns (in pixels)

  • xlabel::String=Time (s): Label for x-axis

  • colorrange::Nothing=nothing: Color range for the image. If nothing, automatically determined

  • show_title::Bool=true: Show title (true/false)

  • xgrid::Bool=false: Show x-axis grid (true/false)

  • colorbar_plot::Bool=true: Whether to show the colorbar

  • add_xy_origin::Bool=true: Add origin lines at x=0 and y=0 (true/false)

  • layout_grid_rowgap::Int64=10: Gap between rows (in pixels)

  • layout_grid_skip_positions::Nothing=nothing: Positions to skip in grid layout as vector of (row, col) tuples, e.g., [(2,1), (2,3)]

  • boxcar_average::Int64=1: Boxcar average window size for smoothing the ERP image (1 = no smoothing)

Returns

  • Figure: The Makie Figure object

  • Vector{Axis}: Vector of axes for the ERP images

Examples

julia
# Plot all channels and samples
plot_erp_image(dat)

# Plot specific channels
plot_erp_image(dat, channel_selection = channels([:Fp1, :Fp2]))

# Exclude reference channels
plot_erp_image(dat, channel_selection = channels_not([:M1, :M2]))

# Plot frontal channels only
plot_erp_image(dat, channel_selection = channels(1:10))

# Custom predicates
plot_erp_image(dat, 
    channel_selection = x -> startswith.(string.(x), "F"),
    sample_selection = x -> x .> 0.0  # Only positive time points
)
source
EegFun.plot_erp_measurements Method
julia
plot_erp_measurements(erp_data, analysis_type;
                      analysis_interval, baseline_interval,
                      layout, channel_selection, condition_selection, kwargs...)

Plot ERP data with measurement overlays computed inline.

Computes a single measurement type across all selected channels and conditions, then overlays the results on the ERP waveforms. Combines measurement computation and visualization in one call.

Arguments

  • erp_data::Union{String, ErpData, Vector{ErpData}}: ERP data (filepath or data object)

  • analysis_type::String: Measurement type (e.g. "mean_amplitude", "max_peak_latency")

Keyword Arguments

  • analysis_interval::Tuple{Real,Real}: Time interval for measurement (default: full range)

  • baseline_interval::Union{Tuple{Real,Real},Nothing}: Baseline interval for correction (default: nothing)

  • layout::Union{Symbol, PlotLayout}: Plot layout — :single, :grid, or :topo (default: :single)

  • channel_selection::Function: Channel selection predicate (default: all channels)

  • condition_selection::Function: Condition selection predicate (default: all conditions)

  • kwargs...: Additional arguments passed to plot_erp and erp_measurements

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • fractional_area_fraction::Float64=0.5: Fraction for fractional area latency (0.0-1.0). Finds latency where this fraction of area is to the left.

  • fractional_peak_fraction::Float64=0.5: Fraction for fractional peak latency (0.0-1.0). Finds latency where amplitude is this fraction of peak.

  • fractional_peak_direction::Symbol=onset: Direction for fractional peak latency: :onset (before peak) or :offset (after peak)

  • local_interval::Int64=3: Number of samples on each side of peak (total interval = 2*local_interval + 1). Peak must be larger than neighbors and local averages within this window.

Overlay Types

  • Peak amplitude → vertical line at peak time, amplitude label

  • Peak latency → vertical line at latency, time label

  • Peak-to-peak → vertical lines at both peaks

  • Mean amplitude → shaded analysis interval + horizontal mean line

  • Area/integral → shaded analysis interval

  • Fractional latency → vertical line at fractional latency point

Examples

julia
dat = EegFun.read_data("erps_good.jld2")

# Mean amplitude in 300-500ms interval
plot_erp_measurements(dat, "mean_amplitude",
    analysis_interval = (0.3, 0.5),
    baseline_interval = (-0.2, 0.0))

# Peak latency
plot_erp_measurements(dat, "max_peak_latency",
    analysis_interval = (0.0, 0.8),
    baseline_interval = (-0.2, 0.0),
    channel_selection = channels([:Cz, :Pz]))

# Load from file path
plot_erp_measurements("erps_good.jld2", "max_peak_amplitude",
    analysis_interval = (0.1, 0.3))
source
EegFun.plot_erp_stats Method
julia
plot_erp_stats(result::StatsResult;
                layout::Union{Symbol, PlotLayout} = :single,
                channel_selection::Function = channels(),
                channel_plot_order::Union{Nothing, Vector{Symbol}} = nothing,
                plot_erp::Bool = true,
                plot_difference::Bool = false,
                plot_tvalues::Bool = false,
                plot_significance::Bool = false,
                plot_critical_t::Bool = false,
                plot_se::Bool = false,
                colors::Vector = [:blue, :red, :black, :purple],
                difference_offset::Real = 0.0,
                significance_position::Union{Symbol, Real} = :auto,
                significance_color = (:gray, 0.6),
                kwargs...)

Plot ERP waveforms and statistical results for analytic or permutation tests with flexible layout support.

Works with both AnalyticResult (from analytic_test) and PermutationResult (from permutation_test).

Arguments

  • result::StatsResult: Results from analytic_test or permutation_test

  • layout: Layout specification:

    • :single (default): Single plot with selected channels overlaid

    • :grid: Grid layout with one subplot per selected channel

    • :topo: Topographic layout based on channel positions

    • PlotLayout: Custom layout object

  • channel_selection::Function: Predicate to select channels (default: channels() - all channels)

  • channel_plot_order::Union{Nothing, Vector{Symbol}}: Override the plotting order of selected channels (default: nothing — data order). When provided, channels are plotted in the specified order. Only channels present in both channel_plot_order and the selection are plotted

  • plot_erp::Bool: Whether to plot ERP waveforms (condition averages) (default: true)

  • plot_difference::Bool: Whether to plot difference wave (A-B) (default: false)

  • plot_tvalues::Bool: Whether to plot t-statistics (default: false)

  • plot_significance::Bool: Whether to highlight significant time points (default: false)

  • plot_critical_t::Bool: Whether to plot critical t-values (default: false). Only relevant when plot_tvalues=true

  • difference_offset::Real: Vertical offset for difference wave (default: 0.0). Set to non-zero to shift for visibility

  • plot_se::Bool: Whether to plot ±1 SEM bands around waveforms (default: false). Bands are drawn around condition ERPs and difference wave

  • significance_position::Union{Symbol, Real}: Position for significance bars (default: :auto). Options:

    • :auto - Automatically place at y=0 if visible, otherwise at bottom (default)

    • :zero - Always place at y=0

    • :bottom - Always place at bottom of plot/spine

    • Real - Custom y-position (e.g., -5.0 to place at -5 μV)

  • significance_color: Color for significance bars (default: (:gray, 0.6)). Can be any Makie color specification

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • legend_imagecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend imagecolorrange parameter

  • legend_meshscattercolor::Observables.Observable{Any}=Observable{Any}(:black): Legend meshscattercolor parameter

  • layout_topo_plot_height::Float64=0.05: Height of individual plots (fraction of figure height)

  • legend_framewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Legend framewidth parameter

  • legend_linewidth::Observables.Observable{Any}=Observable{Any}(1.5): Legend linewidth parameter

  • legend_markercolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend markercolormap parameter

  • legend_surfacecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend surfacecolorrange parameter

  • legend_patchstrokewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Legend patchstrokewidth parameter

  • legend_titleposition::Observables.Observable{Any}=Observable{Any}(:top): Legend titleposition parameter

  • layout_topo_plot_width::Float64=0.05: Width of individual plots (fraction of figure width)

  • legend_patchstrokecolor::Observables.Observable{Any}=Observable{Any}(:transparent): Legend patchstrokecolor parameter

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple. If nothing, automatically determined

  • legend_markerstrokecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend markerstrokecolor parameter

  • xticks::Nothing=nothing: X-axis tick positions (e.g., -0.1:0.1:0.8 or [0, 0.2, 0.4]). If nothing, automatically determined

  • show_title::Bool=true: Show title (true/false)

  • legend_meshscattersize::Observables.Observable{Any}=Observable{Any}(0.8): Legend meshscattersize parameter

  • xgrid::Bool=false: Show x-axis grid (true/false)

  • layout_grid_skip_positions::Nothing=nothing: Positions to skip in grid layout as vector of (row, col) tuples, e.g., [(2,1), (2,3)]

  • legend_patchsize::Observables.Observable{Any}=Observable{Any}((20.0f0, 20.0f0)): Legend patchsize parameter

  • legend_framecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend framecolor parameter

  • legend_titlehalign::Observables.Observable{Any}=Observable{Any}(:center): Legend titlehalign parameter

  • legend_bgcolor::Observables.Observable{Any}=Observable{Any}(nothing): Legend bgcolor parameter

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple. If nothing, automatically determined

  • xminorgrid::Bool=false: Show x-axis minor grid (true/false)

  • legend_position::Symbol=lt: Legend position (:lt, :rt, :lb, :rb, or tuple like (:left, :top), or (0.5, 0.5))

  • legend_labelsize::Observables.Observable{Any}=Observable{Any}(14): Legend labelsize parameter

  • linestyle::Symbol=solid: Line style for ERPs (single style or a vector of styles, one per dataset)

  • legend_colgap::Observables.Observable{Any}=Observable{Any}(16): Legend colgap parameter

  • legend_labelvalign::Observables.Observable{Any}=Observable{Any}(:center): Legend labelvalign parameter

  • legend_halign::Observables.Observable{Any}=Observable{Any}(:right): Legend halign parameter

  • figure_title::String=ERP Plot: Title for the plot window

  • title::String=: Plot title

  • legend_alpha::Observables.Observable{Any}=Observable{Any}(1): Legend alpha parameter

  • legend_titlevalign::Observables.Observable{Any}=Observable{Any}(:center): Legend titlevalign parameter

  • yreversed::Bool=false: Whether to reverse the y-axis

  • legend_backgroundcolor::Observables.Observable{Any}=Observable{Any}(:white): Legend backgroundcolor parameter

  • legend_markercolor::Observables.Observable{Any}=Observable{Any}(:black): Legend markercolor parameter

  • legend_labels::Vector{Any}=Any[]: Legend labels.

  • legend_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Legend height parameter

  • legend_surfacedata::Observables.Observable{Any}=Observable{Any}((-0.7 .. 0.7, -0.7 .. 0.7, [-0.21875 0.17499999999999996 0.48125000000000007 0.7000000000000001 0.8312499999999999 0.875 0.8312499999999999 0.7000000000000001 0.48125000000000007 0.17499999999999996 -0.21875; -0.112 0.08959999999999999 0.24640000000000004 0.35840000000000005 0.4256 0.448 0.4256 0.35840000000000005 0.24640000000000004 0.08959999999999999 -0.112; -0.04725 0.03779999999999999 0.10395000000000001 0.1512 0.17955 0.189 0.17955 0.1512 0.10395000000000001 0.03779999999999999 -0.04725; -0.014 0.011199999999999998 0.030800000000000004 0.044800000000000006 0.0532 0.056 0.0532 0.044800000000000006 0.030800000000000004 0.011199999999999998 -0.014; -0.00175 0.0013999999999999998 0.0038500000000000006 0.005600000000000001 0.00665 0.007 0.00665 0.005600000000000001 0.0038500000000000006 0.0013999999999999998 -0.00175; 0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 0.0; 0.00175 -0.0013999999999999998 -0.0038500000000000006 -0.005600000000000001 -0.00665 -0.007 -0.00665 -0.005600000000000001 -0.0038500000000000006 -0.0013999999999999998 0.00175; 0.014 -0.011199999999999998 -0.030800000000000004 -0.044800000000000006 -0.0532 -0.056 -0.0532 -0.044800000000000006 -0.030800000000000004 -0.011199999999999998 0.014; 0.04725 -0.03779999999999999 -0.10395000000000001 -0.1512 -0.17955 -0.189 -0.17955 -0.1512 -0.10395000000000001 -0.03779999999999999 0.04725; 0.112 -0.08959999999999999 -0.24640000000000004 -0.35840000000000005 -0.4256 -0.448 -0.4256 -0.35840000000000005 -0.24640000000000004 -0.08959999999999999 0.112; 0.21875 -0.17499999999999996 -0.48125000000000007 -0.7000000000000001 -0.8312499999999999 -0.875 -0.8312499999999999 -0.7000000000000001 -0.48125000000000007 -0.17499999999999996 0.21875])): Legend surfacedata parameter

  • ygrid::Bool=false: Show y-axis grid (true/false)

  • layout_grid_colgap::Int64=10: Gap between columns (in pixels)

  • legend_linecolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend linecolorrange parameter

  • legend_heatmaplimits::Observables.Observable{Any}=Observable{Any}((0 .. 1, 0 .. 1)): Legend heatmaplimits parameter

  • legend_meshscatterrotation::Observables.Observable{Any}=Observable{Any}(1.0 + 0.0im + 0.0jm + 0.0km): Legend meshscatterrotation parameter

  • legend_heatmapvalues::Observables.Observable{Any}=Observable{Any}([0.0 0.3; 0.6 1.0]): Legend heatmapvalues parameter

  • legend_tellheight::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend tellheight parameter

  • color::Symbol=black: Color for ERPs (single color or a vector of colors, one per dataset)

  • legend_margin::Observables.Observable{Any}=Observable{Any}((6, 6, 6, 6)): Legend margin parameter

  • legend_polypoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]): Legend polypoints parameter

  • legend_channel::Vector{Any}=Any[]: Which channel to put the legend on.

  • legend_imagevalues::Observables.Observable{Any}=Observable{Any}([0.0 0.3; 0.6 1.0]): Legend imagevalues parameter

  • layout_grid_rowgap::Int64=10: Gap between rows (in pixels)

  • legend_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Legend labelfont parameter

  • legend_orientation::Observables.Observable{Any}=Observable{Any}(:vertical): Legend orientation parameter

  • linewidth::Int64=2: Line width for ERPs

  • layout_topo_scale_offset::Float64=0.1: Offset factor for scale plot position

  • legend_polycolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.4, 0.4, 0.4)): Legend polycolor parameter

  • legend_linepoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.0, 0.5], [1.0, 0.5]]): Legend linepoints parameter

  • layout_grid_dims::Nothing=nothing: Grid dimensions as (rows, cols) tuple for grid layouts. If nothing, automatically determined

  • legend_surfacecolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend surfacecolormap parameter

  • legend_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Legend alignmode parameter

  • colormap::Symbol=jet: Colormap for multi-channel plots

  • yminorgrid::Bool=false: Show y-axis minor grid (true/false)

  • time_unit::Symbol=s: Time unit for x-axis display (😒 or :ms). Only affects axis labels and tick formatting — all intervals remain in seconds.

  • legend_heatmapcolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend heatmapcolorrange parameter

  • legend_meshcolor::Observables.Observable{Any}=Observable{Any}(RGBA{Float32}(0.0, 0.44705883, 0.69803923, 1.0)): Legend meshcolor parameter

  • legend_label::String=: Title for the legend

  • legend_titlesize::Observables.Observable{Any}=Observable{Any}(14): Legend titlesize parameter

  • legend_patchcolor::Observables.Observable{Any}=Observable{Any}(:transparent): Legend patchcolor parameter

  • ylabel::String=μV: Label for y-axis

  • legend_framevisible::Bool=true: Legend frame visible (true/false)

  • legend_polycolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend polycolorrange parameter

  • legend_groupgap::Observables.Observable{Any}=Observable{Any}(16): Legend groupgap parameter

  • display_plot::Bool=true: Display the plot (true/false)

  • interactive::Bool=true: Enable interactive features (true/false)

  • average_channels::Bool=false: Average across channels (true/false)

  • legend_meshcolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend meshcolorrange parameter

  • legend_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Legend labelcolor parameter

  • legend::Bool=true: Show the legend (true/false)

  • xlabel::String=Time (s): Label for x-axis

  • legend_polystrokecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend polystrokecolor parameter

  • legend_linestyle::Observables.Observable{Any}=Observable{Any}(:solid): Legend linestyle parameter

  • legend_meshscattermarker::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Sphere{Float32}(Float32[0.0, 0.0, 0.0], 1.0f0)): Legend meshscattermarker parameter

  • legend_mesh::Observables.Observable{Any}=Observable{Any}(GeometryBasics.HyperRectangle{3, Float32}(Float32[-0.7, -0.7, -0.7], Float32[1.4, 1.4, 1.4])): Legend mesh parameter

  • legend_linecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend linecolor parameter

  • legend_meshcolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend meshcolormap parameter

  • highlight_regions::Nothing=nothing: Highlight regions as a NamedTuple or Vector of NamedTuples. Each region: (x1, x2, y1=-Inf, y2=Inf, color=:gray, alpha=0.3)

  • legend_meshscatterpoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{3, Float32}[[0.0, 0.0, 0.0]]): Legend meshscatterpoints parameter

  • legend_nbanks::Nothing=nothing: Number of legend columns.

  • add_xy_origin::Bool=true: Add origin lines at x=0 and y=0 (true/false)

  • legend_labelhalign::Observables.Observable{Any}=Observable{Any}(:left): Legend labelhalign parameter

  • legend_polycolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend polycolormap parameter

  • legend_rowgap::Observables.Observable{Any}=Observable{Any}(3): Legend rowgap parameter

  • legend_gridsvalign::Observables.Observable{Any}=Observable{Any}(:center): Legend gridsvalign parameter

  • legend_valign::Observables.Observable{Any}=Observable{Any}(:top): Legend valign parameter

  • legend_surfacevalues::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend surfacevalues parameter

  • layout_topo_scale_pos::Tuple{Float64, Float64}=(0.8, -0.8): Fallback position for scale plot in topo layout as (x, y) tuple

  • legend_markerstrokewidth::Observables.Observable{Any}=Observable{Any}(0): Legend markerstrokewidth parameter

  • legend_marker::Observables.Observable{Any}=Observable{Any}(:circle): Legend marker parameter

  • legend_meshscattercolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend meshscattercolormap parameter

  • legend_polystrokewidth::Observables.Observable{Any}=Observable{Any}(0): Legend polystrokewidth parameter

  • legend_labeljustification::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend labeljustification parameter

  • figure_padding::NTuple{4, Int64}=(10, 10, 10, 10): Padding around entire figure as (left, right, top, bottom) tuple (in pixels)

  • legend_tellwidth::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend tellwidth parameter

  • legend_patchlabelgap::Observables.Observable{Any}=Observable{Any}(5): Legend patchlabelgap parameter

  • legend_markersize::Observables.Observable{Any}=Observable{Any}(9): Legend markersize parameter

  • legend_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Legend width parameter

  • legend_titlecolor::Observables.Observable{Any}=Observable{Any}(:black): Legend titlecolor parameter

  • legend_imagelimits::Observables.Observable{Any}=Observable{Any}((0 .. 1, 0 .. 1)): Legend imagelimits parameter

  • legend_linecolormap::Observables.Observable{Any}=Observable{Any}(:viridis): Legend linecolormap parameter

  • legend_padding::Observables.Observable{Any}=Observable{Any}((6.0f0, 6.0f0, 6.0f0, 6.0f0)): Legend padding parameter

  • legend_meshscattercolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend meshscattercolorrange parameter

  • legend_markercolorrange::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Legend markercolorrange parameter

  • legend_gridshalign::Observables.Observable{Any}=Observable{Any}(:center): Legend gridshalign parameter

  • legend_titlevisible::Observables.Observable{Any}=Observable{Any}(true): Legend titlevisible parameter

  • legend_titlegap::Observables.Observable{Any}=Observable{Any}(8): Legend titlegap parameter

  • legend_markerpoints::Observables.Observable{Any}=Observable{Any}(GeometryBasics.Point{2, Float32}[[0.5, 0.5]]): Legend markerpoints parameter

  • yticks::Nothing=nothing: Y-axis tick positions (e.g., -4:2:4 or [-2, 0, 2]). If nothing, automatically determined

  • legend_titlefont::Observables.Observable{Any}=Observable{Any}(:bold): Legend titlefont parameter

Returns

  • Named tuple (fig, axes)

Examples

julia
# With analytic test results - single channel
result = analytic_test(prepared, correction_method=:no)
plot_erp_stats(result, channel_selection=channels(:PO7), 
               plot_erp=true, plot_difference=true, plot_significance=true)

# Grid layout with multiple channels
plot_erp_stats(result, channel_selection=channels([:PO7, :PO8, :Oz, :Pz]),
               layout=:grid, plot_significance=true)

# With permutation test results
result_perm = permutation_test(prepared, n_permutations=1000)
plot_erp_stats(result_perm, channel_selection=channels(:PO7),
               plot_erp=true, plot_significance=true, plot_critical_t=true)
source
EegFun.plot_filter_response Method
julia
plot_filter_response(filter_info::FilterInfo; kwargs...)

Plot the frequency response and impulse response of a digital filter.

Arguments

  • filter_info::FilterInfo: Filter information struct

  • kwargs...: Additional keyword arguments

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • display_plot::Bool=true: Whether to display the plot

  • ygrid::Bool=false: Whether to show y-axis grid

  • xlim::Nothing=nothing: X-axis limits in Hz as (min, max) tuple. If nothing, automatically determined

  • reference_color::Symbol=gray: Color for reference lines

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • ylim::Tuple{Int64, Int64}=(-100, 5): Y-axis limits in dB as (min, max) tuple

  • xlabel::String=Frequency (Hz): X-axis label

  • n_points::Int64=2000: Number of frequency points for response calculation

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • xscale::Makie.ReversibleScale{Makie.var"#forward#1107"{Int64, Float64, Float64}, Makie.var"#inverse#1108"{Int64, Float64, Float64}, IntervalSets.OpenInterval{Float32}}=ReversibleScale(Symlog10): X-axis scale type

  • color::Symbol=blue: Color for response curves

  • reference_lines::Vector{Int64}=[-3, -6]: Reference lines in dB to display

  • label_fontsize::Int64=22: Font size for axis labels

  • ylabel::String=Magnitude (dB): Y-axis label

  • xgrid::Bool=false: Whether to show x-axis grid

  • reference_linestyle::Symbol=dash: Line style for reference lines

  • title::String=Filter Frequency Response: Plot title

  • linewidth::Int64=4: Line width for response curves

  • title_fontsize::Int64=24: Font size for title

  • tick_fontsize::Int64=20: Font size for tick labels

Returns

  • fig: Makie Figure object

  • ax: Tuple of Makie Axis objects (dB, impulse)

source
EegFun.plot_frequency_spectrum Method
julia
plot_frequency_spectrum(spectrum_data::SpectrumData;
                   channel_selection::Function=channels(),
                   x_scale::Symbol=:linear,
                   y_scale::Symbol=:linear,
                   unit::Symbol=:linear,
                   max_freq::Union{Nothing,Real}=nothing,
                   colormap=:default,
                   title::Union{Nothing,String}=nothing,
                   show_legend::Bool=true,
                   linewidth::Real=2,
                   line_alpha::Real=0.8)

Plot power spectrum data for selected channels.

Arguments

  • spectrum_data::SpectrumData: Power spectrum data

Keyword Arguments

  • channel_selection::Function=channels(): Channel selection predicate. See channels() for options.

    • Example: channel_selection=channels(:Cz) for single channel

    • Example: channel_selection=channels([:Cz, :Pz]) for multiple channels

  • x_scale::Symbol=:linear: X-axis scale (:linear or :log10)

  • y_scale::Symbol=:linear: Y-axis scale (:linear or :log10)

  • unit::Symbol=:linear: Power unit (:linear for μV²/Hz or :dB for decibels)

  • max_freq::Union{Nothing,Real}=nothing: Maximum frequency to display in Hz. If nothing, uses all frequencies.

  • colormap: Colormap for lines (default: automatic colors)

  • title::Union{Nothing,String}=nothing: Plot title (default: auto-generated)

  • show_legend::Bool=true: Show legend with channel names

  • linewidth::Real=2: Line width for spectrum lines

  • line_alpha::Real=0.8: Transparency for spectrum lines

Returns

  • (Figure, Axis): Makie figure and axis

Example

julia
# Plot all channels
fig, ax = plot_frequency_spectrum(spectrum_data)

# Single channel with log scales
fig, ax = plot_frequency_spectrum(spectrum_data; 
    channel_selection=channels(:Cz), 
    x_scale=:log10, 
    y_scale=:log10)

# With dB units
fig, ax = plot_frequency_spectrum(spectrum_data; unit=:dB, max_freq=100.0)
source
EegFun.plot_gfp Method
julia
plot_gfp(dat::ErpData;
         channel_selection::Function = channels(),
         normalize::Bool = true,
         kwargs...)

Plot Global Field Power (GFP) for ERP data.

Arguments

  • dat::ErpData: ERP data structure

  • channel_selection::Function: Channel predicate for selecting channels (default: all channels)

  • normalize::Bool: If true, normalize GFP to 0-100% (default: true)

  • kwargs: Additional keyword arguments

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • display_plot::Bool=true: Whether to display the plot

  • ygrid::Bool=false: Whether to show y-axis grid

  • xlim::Nothing=nothing: X-axis limits as (min, max) tuple. If nothing, automatically determined

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • show_erp_traces::Bool=false: Whether to show individual ERP channel traces in top panel

  • ylim::Nothing=nothing: Y-axis limits as (min, max) tuple. If nothing, automatically determined

  • xlabel::String=Time (s): Label for x-axis

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • color::Symbol=black: Color for traces

  • ylabel::Nothing=nothing: Label for y-axis (auto-determined based on normalize flag)

  • linestyle::Symbol=solid: Line style for traces

  • show_title::Bool=true: Whether to show the title

  • xgrid::Bool=false: Whether to show x-axis grid

  • title::String=: Plot title

  • show_dissimilarity::Bool=false: Whether to include Global Dissimilarity panel

  • linewidth::Int64=2: Line width for GFP/dissimilarity traces

  • add_x_origin::Bool=true: Whether to add vertical line at x=0

Examples

julia
using EegFun, JLD2

# Load and plot GFP
erp_data = load("participant_1_erps.jld2", "erps")[1]
plot_gfp(erp_data)

# Plot with individual channel traces
plot_gfp(erp_data, show_erp_traces = true)

# Plot with Global Dissimilarity
plot_gfp(erp_data, show_dissimilarity = true)

# Plot all three panels
plot_gfp(erp_data, show_erp_traces = true, show_dissimilarity = true)

# Custom styling
plot_gfp(erp_data, 
         color = :blue,
         linewidth = 3,
         xlim = (-0.2, 0.8))

Plot Layout

By default, shows only the GFP trace. With show_erp_traces=true, adds a top panel with all channel traces. With show_dissimilarity=true, adds a bottom panel with Global Dissimilarity.

julia
plot_gfp(filepath::String; input_dir=pwd(), participant_selection=participants(), kwargs...)

Load ERP data and plot GFP. Accepts either a .jld2 filepath or a pattern to discover and plot all matching files (one plot per file).

Examples

julia
plot_gfp("erps_good.jld2")
plot_gfp("erps_good")
source
EegFun.plot_gui Method
julia
plot_gui()

Interactive GUI for quick data plotting and visualization.

GUI Structure

Column 1: File & Plot Selection

  • Directory and file browser

  • Plot type dropdown with hierarchical submenus:

    • Common plots: Data Browser, Epochs, ERP, ERP Image, Topography

    • Time-Frequency >: Time-Frequency, Power Spectrum

    • ICA > : Components, Activation

    • ERP Analysis > : ERP GUI

    • Diagnostic Plots >: Artifact Detection, Triggers, Channel Summary, Joint Probability, Correlation Heatmap, Global Field Power, Layout View, Filter Response

Column 2: Data Selection & Layout

  • Participant, Condition, Epoch filters (integers, space/comma-separated)

  • Layout type: Single, Single Avg, Grid, Topo

  • Channel selection with multi-select support

Column 3: Axis Settings

  • X, Y, Z axis limits (validated numeric input with range checking)

  • Baseline correction window and type

  • Display options (invert Y-axis)

Supported Plot Types

See EegFun.jl documentation for complete plot type details and data requirements.

Examples

julia
# Launch GUI
EegFun.plot_gui()

# Navigate to data directory, select file and plot type
# Configure channels and axis limits as needed
# Click "Plot" to generate visualization
source
EegFun.plot_ica_component_activation Method
julia
plot_ica_component_activation(dat::ContinuousData, ica::InfoIca; ...)

Interactive Viewer for ICA Component Activation

Arguments

  • dat::ContinuousData: Continuous EEG data object.

  • ica::InfoIca: ICA results object.

Keyword Arguments

  • artifacts::Union{Nothing,ArtifactComponents}=nothing: Optional artifact detection results. When provided, adds category checkboxes for filtering components.

  • component_selection::Function=components(:all): Predicate to select which components to display.

  • n_visible_components::Int=10: Number of components visible at once (auto-adjusted for selected components).

  • window_size::Int=2000: Initial time window size in samples.

  • topo_kwargs::Dict=Dict(): Keyword arguments passed down for topography plots (see _plot_topo_on_axis!).

  • head_kwargs::Dict=Dict(): Keyword arguments passed down for head outlines.

  • point_kwargs::Dict=Dict(): Keyword arguments passed down for channel markers.

  • label_kwargs::Dict=Dict(): Keyword arguments passed down for channel labels.

Returns

  • fig::Figure: The Makie Figure object containing the interactive plot.
source
EegFun.plot_joint_probability! Method
julia
plot_joint_probability!(fig::Figure, ax::Axis, dat::DataFrame; kwargs...)

Plot a bar chart of joint probability values per channel on the provided figure and axis.

This is the mutating version that plots directly on the provided fig and ax objects.

Assumes the DataFrame dat contains at least two columns:

  • :channel: Containing channel names or identifiers (will be used for x-axis labels).

  • :jp: Containing the joint probability values to plot.

Arguments

  • fig::Figure: The Makie Figure object to plot on

  • ax::Axis: The Makie Axis object to plot on

  • dat::DataFrame: DataFrame with channel and joint probability data.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • sort_values::Bool=false: If true, sort the bars by joint probability values in descending order

  • display_plot::Bool=true: Whether to display the plot

  • ygrid::Bool=true: Whether to show y-axis grid

  • bar_width::Float64=0.8: Width of bars

  • bar_alpha::Float64=0.7: Transparency of bars

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • xlabel::String=Electrode: Label for x-axis

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • label_fontsize::Int64=14: Font size for axis labels

  • ylabel::String=Joint Probability: Label for y-axis

  • xgrid::Bool=true: Whether to show x-axis grid

  • title::String=: Plot title

  • bar_color::Symbol=steelblue: Color of the bars

  • xtick_rotation::Float64=0.7853981633974483: Rotation angle for x-axis tick labels

  • title_fontsize::Int64=16: Font size for title

  • tick_fontsize::Int64=12: Font size for tick labels

Returns

  • nothing (modifies the provided figure and axis in-place)

Example

julia
# Basic usage
fig = Figure()
ax = Axis(fig[1, 1])
plot_joint_probability!(fig, ax, jp_df)

# Custom styling
plot_joint_probability!(fig, ax, jp_df;
    title = "Custom Joint Probability",
    bar_color = :orange,
    sort_values = true)
source
EegFun.plot_joint_probability Method
julia
plot_joint_probability(dat::DataFrame; kwargs...)

Plot a bar chart of joint probability values per channel.

Assumes the DataFrame dat contains at least two columns:

  • :channel: Containing channel names or identifiers (will be used for x-axis labels).

  • :jp: Containing the joint probability values to plot.

Arguments

  • dat::DataFrame: DataFrame with channel and joint probability data.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • sort_values::Bool=false: If true, sort the bars by joint probability values in descending order

  • display_plot::Bool=true: Whether to display the plot

  • ygrid::Bool=true: Whether to show y-axis grid

  • bar_width::Float64=0.8: Width of bars

  • bar_alpha::Float64=0.7: Transparency of bars

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • xlabel::String=Electrode: Label for x-axis

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • label_fontsize::Int64=14: Font size for axis labels

  • ylabel::String=Joint Probability: Label for y-axis

  • xgrid::Bool=true: Whether to show x-axis grid

  • title::String=: Plot title

  • bar_color::Symbol=steelblue: Color of the bars

  • xtick_rotation::Float64=0.7853981633974483: Rotation angle for x-axis tick labels

  • title_fontsize::Int64=16: Font size for title

  • tick_fontsize::Int64=12: Font size for tick labels

Returns

  • Figure: The Makie Figure object.

  • Axis: The Makie Axis object for the bar plot.

Example

julia
# Basic usage
fig, ax = plot_joint_probability(jp_df)

# Custom styling
fig, ax = plot_joint_probability(jp_df;
    title = "Joint Probability Analysis",
    bar_color = :red,
    sort_values = true,
    grid_visible = false)
source
EegFun.plot_layout_2d! Method
julia
plot_layout_2d!(fig::Figure, ax::Axis, layout::Layout; neighbours::Bool=false, correlation_matrix::Union{DataFrame, Nothing}=nothing, kwargs...)

Plot a 2D EEG electrode layout with customizable head shape, electrode points, and labels.

Arguments

  • fig: The figure to plot on

  • ax: The axis to plot on

  • layout: Layout containing electrode positions with columns x2, y2, and label

  • neighbours: Boolean to show interactive neighbour connections (default: false). Ignored if correlation_matrix is provided.

  • correlation_matrix: Optional DataFrame from correlation_matrix() to show correlation values on hover (default: nothing). When provided, neighbours is ignored.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Int64=1: Radius of the head shape (normalized units).

  • head_color::Symbol=black: Color of the head shape outline.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • point_markersize::Int64=12: Size of electrode point markers.

  • point_color::Symbol=black: Color of electrode points.

  • point_marker::Symbol=circle: Marker style for electrode points.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • label_fontsize::Int64=20: Font size for electrode labels.

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • label_zoffset::Int64=0: Z-axis offset for electrode labels (3D only).

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • label_color::Symbol=black: Color of electrode labels.

Returns

  • nothing (modifies the provided figure and axis in-place)

Example

julia
layout = Layout("biosemi64.csv")
polar_to_cartesian_xy!(layout)
fig = Figure()
ax = Axis(fig[1, 1])
plot_layout_2d!(fig, ax, layout)

# With correlation matrix
cm = correlation_matrix(dat)
plot_layout_2d!(fig, ax, layout, correlation_matrix=cm)
source
EegFun.plot_layout_2d Method
julia
plot_layout_2d(layout::Layout; neighbours::Bool=false, correlation_matrix::Union{DataFrame, Nothing}=nothing, display_plot::Bool=true, kwargs...)

Create a new figure and plot a 2D EEG electrode layout.

Arguments

  • layout: Layout containing electrode positions

  • neighbours: Boolean to show interactive neighbour connections (default: false). Ignored if correlation_matrix is provided.

  • correlation_matrix: Optional DataFrame from correlation_matrix() to show correlation values on hover (default: nothing). When provided, neighbours is ignored.

  • display_plot: Boolean to display the plot (default: true)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Int64=1: Radius of the head shape (normalized units).

  • head_color::Symbol=black: Color of the head shape outline.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • point_markersize::Int64=12: Size of electrode point markers.

  • point_color::Symbol=black: Color of electrode points.

  • point_marker::Symbol=circle: Marker style for electrode points.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • label_fontsize::Int64=20: Font size for electrode labels.

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • label_zoffset::Int64=0: Z-axis offset for electrode labels (3D only).

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • label_color::Symbol=black: Color of electrode labels.

Returns

  • The figure and axis objects

Example

julia
layout = read_layout("./layouts/biosemi64.csv")
polar_to_cartesian_xy!(layout)
plot_layout_2d(layout)
# With neighbour interactivity
plot_layout_2d(layout, neighbours=true)
# With correlation matrix
cm = correlation_matrix(dat)
plot_layout_2d(layout, correlation_matrix=cm)
source
EegFun.plot_layout_3d! Method
julia
plot_layout_3d!(fig::Figure, ax::Axis3, layout::Layout; neighbours::Bool=false, kwargs...)

Plot a 3D EEG electrode layout with customizable head shape, electrode points, and labels.

Arguments

  • fig: The figure to plot on

  • ax: The axis to plot on

  • layout: Layout containing electrode positions with columns x3, y3, z3, and label

  • neighbours: Boolean to show interactive neighbour connections (default: false)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Int64=1: Radius of the head shape (normalized units).

  • head_color::Symbol=black: Color of the head shape outline.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • point_markersize::Int64=12: Size of electrode point markers.

  • point_color::Symbol=black: Color of electrode points.

  • point_marker::Symbol=circle: Marker style for electrode points.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • label_fontsize::Int64=20: Font size for electrode labels.

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • label_zoffset::Int64=0: Z-axis offset for electrode labels (3D only).

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • label_color::Symbol=black: Color of electrode labels.

Returns

  • nothing (modifies the provided figure and axis in-place)

Example

julia
layout = Layout("biosemi64.csv")
polar_to_cartesian_xyz!(layout)
fig = Figure()
ax = Axis3(fig[1, 1])
plot_layout_3d!(fig, ax, layout)
source
EegFun.plot_layout_3d Method
julia
plot_layout_3d(layout::Layout; neighbours::Bool=false, display_plot::Bool=true, kwargs...)

Create a new figure and plot a 3D EEG electrode layout.

Arguments

  • layout: Layout containing electrode positions

  • neighbours: Boolean to show interactive neighbour connections (default: false)

  • display_plot: Boolean to display the plot (default: true)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Int64=1: Radius of the head shape (normalized units).

  • head_color::Symbol=black: Color of the head shape outline.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • point_markersize::Int64=12: Size of electrode point markers.

  • point_color::Symbol=black: Color of electrode points.

  • point_marker::Symbol=circle: Marker style for electrode points.

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • label_fontsize::Int64=20: Font size for electrode labels.

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • label_zoffset::Int64=0: Z-axis offset for electrode labels (3D only).

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • label_color::Symbol=black: Color of electrode labels.

Returns

  • The figure and axis objects

Example

julia
layout = read_layout("./layouts/biosemi64.csv")
polar_to_cartesian_xyz!(layout)
plot_layout_3d(layout)
# With neighbour interactivity
plot_layout_3d(layout, neighbours=true)
source
EegFun.plot_line_noise_components Method
julia
plot_line_noise_components(line_noise_comps::Vector{Int}, metrics_df::DataFrame; kwargs...)

Plot spectral metrics used for line noise component identification.

Arguments

  • line_noise_comps::Vector{Int}: Vector of component indices identified as line noise.

  • metrics_df::DataFrame: DataFrame containing line noise metrics. Expected to have columns :Component, :power_ratio_zscore, and :harmonic_ratio.

Keyword Arguments

  • z_threshold::Float64: Z-score threshold for the reference line (default: 3.0).

  • min_harmonic_power::Real: Minimum harmonic power reference line (default: 0.5).

  • display_plot::Bool: Whether to display the plot (default: true).

Returns

  • Named tuple (fig, axes) where axes = (ax1, ax2).
source
EegFun.plot_model_correlations Method
julia
plot_model_correlations(rsa_data::RsaData; kwargs...)

Plot model correlations over time.

Arguments

  • rsa_data::RsaData: RSA results with model comparisons

  • kwargs: Additional keyword arguments

Examples

julia
# Plot correlations with models
plot_model_correlations(rsa_result)

# Custom styling
plot_model_correlations(rsa_result, colors=[:red, :blue], title="Model Comparison")
source
EegFun.plot_rdm_heatmap Method
julia
plot_rdm_heatmap(rsa_data::RsaData; time_point::Union{Float64, Int, Nothing} = nothing, kwargs...)

Plot Representational Dissimilarity Matrix (RDM) as a heatmap.

Shows a matrix visualization of pairwise dissimilarities between conditions at a specific time point or averaged across time.

Arguments

  • rsa_data::RsaData: RSA results

  • time_point::Union{Float64, Int, Nothing}: Time point to plot (Float64 = time in seconds, Int = index, nothing = average across time)

  • kwargs: Additional keyword arguments

Examples

julia
# Plot RDM at a specific time point
plot_rdm_heatmap(rsa_result, time_point=0.3)

# Plot average RDM across all time points
plot_rdm_heatmap(rsa_result)

# Plot RDM at time index 50
plot_rdm_heatmap(rsa_result, time_point=50)
source
EegFun.plot_rdm_timecourse Method
julia
plot_rdm_timecourse(
    rsa_data::RsaData;
    condition_pairs::Union{Vector{Tuple{Int,Int}}, Symbol, Nothing} = :all,
    kwargs...
)

Plot dissimilarity timecourse for condition pairs.

Shows how dissimilarity between conditions evolves over time as lines. This helps visualize when conditions become distinguishable.

Arguments

  • rsa_data::RsaData: RSA results

  • condition_pairs: Which condition pairs to plot

    • :all - All pairwise comparisons (default)

    • :upper - Upper triangle only (same as :all, no duplicates)

    • Vector{Tuple{Int,Int}} - Specific pairs, e.g., [(1,2), (1,3)]

  • kwargs: Additional keyword arguments

Examples

julia
# Plot all condition pairs
plot_rdm_timecourse(rsa_result)

# Plot only specific pairs
plot_rdm_timecourse(rsa_result, condition_pairs=[(1,2), (1,3)])

# Custom styling
plot_rdm_timecourse(rsa_result, title="Dissimilarity Over Time")
source
EegFun.plot_rsa Method
julia
plot_rsa(rsa_data::RsaData; kwargs...)

Main plotting function for RSA results.

If model correlations are available, plots them. Otherwise, plots RDM heatmap at average time.

Arguments

  • rsa_data::RsaData: RSA results

  • kwargs: Additional keyword arguments (passed to plot_model_correlations or plot_rdm_heatmap)

Examples

julia
# Plot RSA results (automatically chooses best visualization)
plot_rsa(rsa_result)

# Force RDM heatmap plot
plot_rsa(rsa_result, plot_type=:rdm, time_point=0.3)
julia
plot_rsa(filepath::String; input_dir=pwd(), participant_selection=participants(), kwargs...)

Load RSA data and plot. Accepts either a .jld2 filepath or a pattern to discover and plot all matching files (one plot per file).

Examples

julia
plot_rsa("rsa_results.jld2")
plot_rsa("rsa_results")
source
EegFun.plot_spatial_kurtosis_components Method
julia
plot_spatial_kurtosis_components(kurtosis_comps::Vector{Int}, metrics_df::DataFrame; kwargs...)

Plot spatial kurtosis z-scores for all ICA components and highlight those exceeding the threshold.

Arguments

  • kurtosis_comps::Vector{Int}: Vector of component indices identified as having high spatial kurtosis.

  • metrics_df::DataFrame: DataFrame containing spatial kurtosis metrics. Expected to have columns :Component and :z_spatial_kurtosis.

Keyword Arguments

  • z_threshold::Float64: Z-score threshold for the reference line (default: 3.0).

  • display_plot::Bool: Whether to display the plot (default: true).

Returns

  • Named tuple (fig, axis).
source
EegFun.plot_tf Method
julia
plot_tf(filepath::String; kwargs...)
plot_tf(tf::TimeFreqData; channel_selection, baseline_interval, kwargs...)
plot_tf(tfs::Vector{TimeFreqData}; channel_selection, baseline_interval, kwargs...)

Plot time-frequency data as a heatmap (time × frequency). Supports single condition, multi-condition grid, and topographic layouts.

Arguments

  • filepath::String: Path to a .jld2 file, or a TimeFreqData / Vector{TimeFreqData} object

  • channel_selection::Function: Channel filter (default: all channels)

  • baseline_interval: Baseline window as (start, stop) in seconds (default: nothing)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • layout_grid_dims::Nothing=nothing: Grid dimensions as (rows, cols) tuple. If nothing, automatically determined

  • colorbar::Bool=true: Whether to show a colorbar

  • display_plot::Bool=true: Whether to display the plot

  • interpolate::Bool=false: Whether to interpolate the heatmap for a smoother appearance

  • xlim::Nothing=nothing: X-axis time limits as (min, max) tuple in seconds. If nothing, shows all time points

  • colormap::Symbol=viridis: Colormap for the heatmap

  • layout_grid_colgap::Int64=10: Gap between columns in grid layout (pixels)

  • layout_topo_plot_height::Float64=0.1: Height of individual plots in topo layout (fraction of figure height)

  • layout::Symbol=single: Layout type: :single, :grid, or :topo

  • colorrange::Nothing=nothing: Color range as (min, max) tuple. If nothing, automatically determined from data

  • ylogscale::Bool=false: Whether to use logarithmic scale for the frequency (y) axis

  • layout_grid_rowgap::Int64=10: Gap between rows in grid layout (pixels)

  • title::Nothing=nothing: Plot title. If nothing, automatically determined from condition name and channel

  • baseline_method::Symbol=db: Baseline correction method: :db, :absolute, :relative, :relchange, :percent, :zscore

  • layout_topo_plot_width::Float64=0.1: Width of individual plots in topo layout (fraction of figure width)

Examples

julia
plot_tf("tf_morlet_result.jld2")
plot_tf("tf_morlet_result.jld2"; layout=:grid, channel_selection=channels([:Cz, :Pz]))
plot_tf(tf; colormap=:RdBu, ylogscale=true, baseline_interval=(-0.3, 0.0))
source
EegFun.plot_tf_stats Method
julia
plot_tf_stats(result::TFStatsResult;
              channel_selection::Function = channels(),
              channel_plot_order::Union{Nothing, Vector{Symbol}} = nothing,
              content::Symbol = :tvalues,
              significance::Symbol = :contour,
              colormap = :RdBu,
              colorrange = nothing,
              ylogscale::Bool = false,
              colorbar::Bool = true,
              significance_color = :black,
              significance_linewidth::Real = 2.0,
              stipple_alpha::Real = 0.4,
              opacity_alpha::Real = 0.3,
              figure_size = nothing,
              display_plot::Bool = true)

Plot TF statistical results as heatmaps with significance overlays.

Works with both TFClusterPermutationResult (from permutation_test) and TFAnalyticResult (from analytic_test).

Arguments

  • result::TFStatsResult: Statistical result to plot

  • channel_selection::Function: Channel selection predicate (default: all channels)

  • content::Symbol: What to plot as the heatmap:

    • :tvalues (default) - t-statistic values

    • :difference - power difference (condition A - B)

    • :power_a - grand average power for condition A

    • :power_b - grand average power for condition B

  • significance::Symbol: How to visualize significant regions:

    • :contour (default) - black contour lines around significant regions

    • :stipple - semi-transparent dots over non-significant regions

    • :opacity - dim non-significant regions

    • :none - no significance overlay

  • colormap: Colormap (default: :RdBu)

  • colorrange: Color range tuple or nothing for auto (auto-symmetric for t-values)

  • ylogscale::Bool: Log scale for frequencies (default: false)

  • colorbar::Bool: Show colorbar (default: true)

  • significance_color: Color for contour lines (default: :black)

  • significance_linewidth::Real: Width of contour lines (default: 2.0)

  • stipple_alpha::Real: Alpha for stipple dots (default: 0.4)

  • opacity_alpha::Real: Alpha for dimming non-significant regions (default: 0.3)

  • figure_size: Figure size tuple or nothing for auto

  • display_plot::Bool: Display the plot (default: true)

Returns

Named tuple (fig, axes) with Makie Figure and vector of Axes.

Examples

julia
# Basic t-value heatmap with contour significance
result = permutation_test(prepared; n_permutations=1000, cluster_type=:temporal)
plot_tf_stats(result, channel_selection=channels(:Cz))

# Power difference with stipple overlay
plot_tf_stats(result, content=:difference, significance=:stipple)

# Multiple channels in grid
plot_tf_stats(result, channel_selection=channels([:Cz, :Fz, :Pz, :Oz]))

# With analytic test results
result_analytic = analytic_test(prepared)
plot_tf_stats(result_analytic, significance=:opacity, colormap=:viridis)
source
EegFun.plot_topography! Method

In-place topographic plot for a specific epoch of multi-epoch data.

source
EegFun.plot_topography! Method

In-place topographic plot: subset data and render onto an existing figure/axis.

source
EegFun.plot_topography Method
julia
plot_topography(ica::InfoIca; ...)

Plot multiple ICA component topographies in a grid layout within a new Figure.

Arguments

  • ica::InfoIca: The ICA result object (contains layout information).

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • colorbar_nsteps::Observables.Observable{Any}=Observable{Any}(100): Colorbar nsteps parameter

  • colorbar_leftspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar leftspinevisible parameter

  • colorbar_limits::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar limits parameter

  • point_markersize::Int64=12: Size of electrode point markers.

  • colorbar_size::Observables.Observable{Any}=Observable{Any}(12): Colorbar size parameter

  • colorbar_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Colorbar alignmode parameter

  • colorbar_topspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar topspinecolor parameter

  • colorbar_plot_numbers::Vector{Any}=Any[]: Plot indices for which to show colorbars. Empty list shows colorbars for all plots.

  • colorbar_ticksize::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar ticksize parameter

  • colorbar_minortickcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar minortickcolor parameter

  • colorbar_halign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar halign parameter

  • colorbar_ticksvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticksvisible parameter

  • colorbar_tellheight::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellheight parameter

  • colorbar_vertical::Observables.Observable{Any}=Observable{Any}(true): Colorbar vertical parameter

  • colorbar_ticklabelspace::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelspace parameter

  • colorbar_ticklabelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar ticklabelfont parameter

  • colorbar_minortickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar minortickwidth parameter

  • colorbar_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar width parameter

  • colorbar_leftspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar leftspinecolor parameter

  • show_title::Bool=true: Whether to show the title

  • colorbar_colorrange::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar colorrange parameter

  • colorbar_plot::Bool=true: Whether to display the colorbar

  • colorbar_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar labelcolor parameter

  • num_levels::Int64=20: Number of contour levels (for ICA plots). For standard plots, use ylim instead.

  • gridscale::Int64=75: Grid resolution for interpolation

  • ylim::Nothing=nothing: Y-axis limits (nothing for auto). For ICA plots, use num_levels instead.

  • method::Symbol=thin_plate: Interpolation method: :multiquadratic, :inverse_multiquadratic, :gaussian, :inverse_quadratic, :thin_plate, :polyharmonic, :shepard, :nearest, :spherical_spline. See https://eljungsk.github.io/ScatteredInterpolation.jl/dev/methods/ for details on methods.

  • colorbar_minorticksvisible::Observables.Observable{Any}=Observable{Any}(false): Colorbar minorticksvisible parameter

  • colorbar_valign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar valign parameter

  • figure_title::String=Topography Plot: Title for the plot window

  • title::String=: Plot title

  • colorbar_label::String=μV: Label for the colorbar

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • colorbar_colormap::Observables.Observable{Any}=Observable{Any}(:viridis): Colorbar colormap parameter

  • colorbar_flip_vertical_label::Observables.Observable{Any}=Observable{Any}(false): Colorbar flip_vertical_label parameter

  • point_color::Symbol=black: Color of electrode points.

  • colorbar_lowclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar lowclip parameter

  • colorbar_scale::Observables.Observable{Any}=Observable{Any}(identity): Colorbar scale parameter

  • colorbar_flipaxis::Observables.Observable{Any}=Observable{Any}(true): Colorbar flipaxis parameter

  • colorbar_tellwidth::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellwidth parameter

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Colorbar position as (row, col) tuple, or :right, :below

  • colorbar_labelvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar labelvisible parameter

  • dims::Nothing=nothing: Grid dimensions (rows, cols). If nothing, calculates best square-ish grid

  • colormap::Symbol=jet: Colormap for the topography

  • time_unit::Symbol=s: Time unit for display labels (😒 or :ms). Only affects title strings — all intervals and selections remain in seconds.

  • colorbar_ticklabelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar ticklabelsize parameter

  • colorbar_rightspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar rightspinecolor parameter

  • colorbar_labelpadding::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar labelpadding parameter

  • colorbar_spinewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar spinewidth parameter

  • colorbar_bottomspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar bottomspinevisible parameter

  • component_selection::EegFun.var"#components##0#components##1"=#components##0: Function that returns boolean vector for component filtering

  • colorbar_ticklabelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar ticklabelcolor parameter

  • use_global_scale::Bool=false: Do multiple ICA topoplots share the same color scale based on min/max across all components?

  • point_marker::Symbol=circle: Marker style for electrode points.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • colorbar_tickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar tickwidth parameter

  • display_plot::Bool=true: Whether to display the plot

  • interactive::Bool=true: Whether to enable interactive features

  • colorbar_tickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar tickalign parameter

  • colorbar_ticklabelpad::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar ticklabelpad parameter

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • colorbar_labelrotation::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar labelrotation parameter

  • colorbar_ticklabelsvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticklabelsvisible parameter

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Float64=1.0: Radius of the head shape in mm.

  • title_fontsize::Int64=16: Font size for the title

  • colorbar_topspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar topspinevisible parameter

  • head_color::Symbol=black: Color of the head shape outline.

  • colorbar_minorticksize::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar minorticksize parameter

  • colorbar_tickformat::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar tickformat parameter

  • label_fontsize::Int64=20: Font size for electrode labels.

  • colorbar_ticklabelrotation::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar ticklabelrotation parameter

  • colorbar_rightspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar rightspinevisible parameter

  • colorbar_labelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar labelsize parameter

  • colorbar_bottomspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar bottomspinecolor parameter

  • label_color::Symbol=black: Color of electrode labels.

  • colorbar_minorticks::Observables.Observable{Any}=Observable{Any}(Makie.IntervalsBetween(5, true)): Colorbar minorticks parameter

  • colorbar_minortickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar minortickalign parameter

  • highlight_channels::Nothing=nothing: Highlight channel groups as a NamedTuple or Vector of NamedTuples. Each group: (channels=[:Cz, :Pz], color=:white, size=8, marker=:circle)

  • colorbar_ticks::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticks parameter

  • colorbar_ticklabelalign::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelalign parameter

  • colorbar_highclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar highclip parameter

  • colorbar_tickcolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar tickcolor parameter

  • colorbar_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar height parameter

  • colorbar_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar labelfont parameter

Returns

  • fig::Figure: The generated Makie Figure containing the grid of topoplots.

Examples

Basic Usage

julia
# Plot first 10 components (default)
fig = plot_topography(ica)

# Plot specific range of components
fig = plot_topography(ica, component_selection = components(5:15))

# Plot specific components
fig = plot_topography(ica, component_selection = components([1, 3, 5, 7]))

# Plot all components (if screen can handle it)
fig = plot_topography(ica, component_selection = components())

Advanced Selection

julia
# Plot components with custom selection
fig = plot_topography(ica, 
    component_selection = components(1:10)  # First 10 components
)

# Plot even-numbered components
fig = plot_topography(ica, 
    component_selection = components(2:2:20)  # Even components 2, 4, 6, ..., 20
)
source
EegFun.plot_topography Method

Create a topographic plot for a specific epoch of MultiDataFrameEeg data.

source
EegFun.plot_topography Method

Create a topographic plot for a single SingleDataFrameEeg; supports n_topo time bins.

source
EegFun.plot_topography Method
julia
plot_topography(tf::TimeFreqData;
                 freq_range::Tuple{Real, Real},
                 interval_selection::Interval = times(),
                 baseline_interval = nothing,
                 baseline_method::Symbol = :db,
                 kwargs...)

Plot a topographic map of average power within a frequency band and time window.

Arguments

  • tf::TimeFreqData: Time-frequency data

  • freq_range::Tuple{Real, Real}: Frequency range to average over (e.g., (8.0, 12.0) for alpha)

  • interval_selection::Interval: Time window (default: all time points)

  • baseline_interval: Baseline window as (start, stop) in seconds (e.g., (-0.3, 0.0)). Default: nothing

  • baseline_method::Symbol: Baseline method (default: :db). Options: :db, :absolute, :relative, :relchange, :percent, :zscore

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • colorbar_nsteps::Observables.Observable{Any}=Observable{Any}(100): Colorbar nsteps parameter

  • colorbar_leftspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar leftspinevisible parameter

  • colorbar_limits::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar limits parameter

  • point_markersize::Int64=12: Size of electrode point markers.

  • colorbar_size::Observables.Observable{Any}=Observable{Any}(12): Colorbar size parameter

  • colorbar_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Colorbar alignmode parameter

  • colorbar_topspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar topspinecolor parameter

  • colorbar_plot_numbers::Vector{Any}=Any[]: Plot indices for which to show colorbars. Empty list shows colorbars for all plots.

  • colorbar_ticksize::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar ticksize parameter

  • colorbar_minortickcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar minortickcolor parameter

  • colorbar_halign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar halign parameter

  • colorbar_ticksvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticksvisible parameter

  • colorbar_tellheight::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellheight parameter

  • colorbar_vertical::Observables.Observable{Any}=Observable{Any}(true): Colorbar vertical parameter

  • colorbar_ticklabelspace::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelspace parameter

  • colorbar_ticklabelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar ticklabelfont parameter

  • colorbar_minortickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar minortickwidth parameter

  • colorbar_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar width parameter

  • colorbar_leftspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar leftspinecolor parameter

  • show_title::Bool=true: Whether to show the title

  • colorbar_colorrange::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar colorrange parameter

  • colorbar_plot::Bool=true: Whether to display the colorbar

  • colorbar_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar labelcolor parameter

  • num_levels::Int64=20: Number of contour levels (for ICA plots). For standard plots, use ylim instead.

  • gridscale::Int64=75: Grid resolution for interpolation

  • ylim::Nothing=nothing: Y-axis limits (nothing for auto). For ICA plots, use num_levels instead.

  • method::Symbol=thin_plate: Interpolation method: :multiquadratic, :inverse_multiquadratic, :gaussian, :inverse_quadratic, :thin_plate, :polyharmonic, :shepard, :nearest, :spherical_spline. See https://eljungsk.github.io/ScatteredInterpolation.jl/dev/methods/ for details on methods.

  • colorbar_minorticksvisible::Observables.Observable{Any}=Observable{Any}(false): Colorbar minorticksvisible parameter

  • colorbar_valign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar valign parameter

  • figure_title::String=Topography Plot: Title for the plot window

  • title::String=: Plot title

  • colorbar_label::String=μV: Label for the colorbar

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • colorbar_colormap::Observables.Observable{Any}=Observable{Any}(:viridis): Colorbar colormap parameter

  • colorbar_flip_vertical_label::Observables.Observable{Any}=Observable{Any}(false): Colorbar flip_vertical_label parameter

  • point_color::Symbol=black: Color of electrode points.

  • colorbar_lowclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar lowclip parameter

  • colorbar_scale::Observables.Observable{Any}=Observable{Any}(identity): Colorbar scale parameter

  • colorbar_flipaxis::Observables.Observable{Any}=Observable{Any}(true): Colorbar flipaxis parameter

  • colorbar_tellwidth::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellwidth parameter

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Colorbar position as (row, col) tuple, or :right, :below

  • colorbar_labelvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar labelvisible parameter

  • dims::Nothing=nothing: Grid dimensions (rows, cols). If nothing, calculates best square-ish grid

  • colormap::Symbol=jet: Colormap for the topography

  • time_unit::Symbol=s: Time unit for display labels (😒 or :ms). Only affects title strings — all intervals and selections remain in seconds.

  • colorbar_ticklabelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar ticklabelsize parameter

  • colorbar_rightspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar rightspinecolor parameter

  • colorbar_labelpadding::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar labelpadding parameter

  • colorbar_spinewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar spinewidth parameter

  • colorbar_bottomspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar bottomspinevisible parameter

  • component_selection::EegFun.var"#components##0#components##1"=#components##0: Function that returns boolean vector for component filtering

  • colorbar_ticklabelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar ticklabelcolor parameter

  • use_global_scale::Bool=false: Do multiple ICA topoplots share the same color scale based on min/max across all components?

  • point_marker::Symbol=circle: Marker style for electrode points.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • colorbar_tickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar tickwidth parameter

  • display_plot::Bool=true: Whether to display the plot

  • interactive::Bool=true: Whether to enable interactive features

  • colorbar_tickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar tickalign parameter

  • colorbar_ticklabelpad::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar ticklabelpad parameter

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • colorbar_labelrotation::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar labelrotation parameter

  • colorbar_ticklabelsvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticklabelsvisible parameter

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Float64=1.0: Radius of the head shape in mm.

  • title_fontsize::Int64=16: Font size for the title

  • colorbar_topspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar topspinevisible parameter

  • head_color::Symbol=black: Color of the head shape outline.

  • colorbar_minorticksize::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar minorticksize parameter

  • colorbar_tickformat::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar tickformat parameter

  • label_fontsize::Int64=20: Font size for electrode labels.

  • colorbar_ticklabelrotation::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar ticklabelrotation parameter

  • colorbar_rightspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar rightspinevisible parameter

  • colorbar_labelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar labelsize parameter

  • colorbar_bottomspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar bottomspinecolor parameter

  • label_color::Symbol=black: Color of electrode labels.

  • colorbar_minorticks::Observables.Observable{Any}=Observable{Any}(Makie.IntervalsBetween(5, true)): Colorbar minorticks parameter

  • colorbar_minortickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar minortickalign parameter

  • highlight_channels::Nothing=nothing: Highlight channel groups as a NamedTuple or Vector of NamedTuples. Each group: (channels=[:Cz, :Pz], color=:white, size=8, marker=:circle)

  • colorbar_ticks::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticks parameter

  • colorbar_ticklabelalign::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelalign parameter

  • colorbar_highclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar highclip parameter

  • colorbar_tickcolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar tickcolor parameter

  • colorbar_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar height parameter

  • colorbar_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar labelfont parameter

Returns

  • Named tuple (fig, ax)

Examples

julia
# Alpha-band power (8-12 Hz) in 300-500ms window with dB baseline
plot_topography(tf, freq_range=(8.0, 12.0), interval_selection=times(0.3, 0.5),
                baseline_interval=(-0.3, 0.0))

# Theta-band power across full time window
plot_topography(tf, freq_range=(4.0, 7.0))
source
EegFun.plot_topography Method
julia
plot_topography(filepath::String; input_dir=pwd(), participant_selection=participants(), kwargs...)

Load data and create topographic plots. Accepts either a .jld2 filepath or a pattern to discover and plot all matching files (one plot per file).

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • colorbar_nsteps::Observables.Observable{Any}=Observable{Any}(100): Colorbar nsteps parameter

  • colorbar_leftspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar leftspinevisible parameter

  • colorbar_limits::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar limits parameter

  • point_markersize::Int64=12: Size of electrode point markers.

  • colorbar_size::Observables.Observable{Any}=Observable{Any}(12): Colorbar size parameter

  • colorbar_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Colorbar alignmode parameter

  • colorbar_topspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar topspinecolor parameter

  • colorbar_plot_numbers::Vector{Any}=Any[]: Plot indices for which to show colorbars. Empty list shows colorbars for all plots.

  • colorbar_ticksize::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar ticksize parameter

  • colorbar_minortickcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar minortickcolor parameter

  • colorbar_halign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar halign parameter

  • colorbar_ticksvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticksvisible parameter

  • colorbar_tellheight::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellheight parameter

  • colorbar_vertical::Observables.Observable{Any}=Observable{Any}(true): Colorbar vertical parameter

  • colorbar_ticklabelspace::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelspace parameter

  • colorbar_ticklabelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar ticklabelfont parameter

  • colorbar_minortickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar minortickwidth parameter

  • colorbar_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar width parameter

  • colorbar_leftspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar leftspinecolor parameter

  • show_title::Bool=true: Whether to show the title

  • colorbar_colorrange::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar colorrange parameter

  • colorbar_plot::Bool=true: Whether to display the colorbar

  • colorbar_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar labelcolor parameter

  • num_levels::Int64=20: Number of contour levels (for ICA plots). For standard plots, use ylim instead.

  • gridscale::Int64=75: Grid resolution for interpolation

  • ylim::Nothing=nothing: Y-axis limits (nothing for auto). For ICA plots, use num_levels instead.

  • method::Symbol=thin_plate: Interpolation method: :multiquadratic, :inverse_multiquadratic, :gaussian, :inverse_quadratic, :thin_plate, :polyharmonic, :shepard, :nearest, :spherical_spline. See https://eljungsk.github.io/ScatteredInterpolation.jl/dev/methods/ for details on methods.

  • colorbar_minorticksvisible::Observables.Observable{Any}=Observable{Any}(false): Colorbar minorticksvisible parameter

  • colorbar_valign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar valign parameter

  • figure_title::String=Topography Plot: Title for the plot window

  • title::String=: Plot title

  • colorbar_label::String=μV: Label for the colorbar

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • colorbar_colormap::Observables.Observable{Any}=Observable{Any}(:viridis): Colorbar colormap parameter

  • colorbar_flip_vertical_label::Observables.Observable{Any}=Observable{Any}(false): Colorbar flip_vertical_label parameter

  • point_color::Symbol=black: Color of electrode points.

  • colorbar_lowclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar lowclip parameter

  • colorbar_scale::Observables.Observable{Any}=Observable{Any}(identity): Colorbar scale parameter

  • colorbar_flipaxis::Observables.Observable{Any}=Observable{Any}(true): Colorbar flipaxis parameter

  • colorbar_tellwidth::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellwidth parameter

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Colorbar position as (row, col) tuple, or :right, :below

  • colorbar_labelvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar labelvisible parameter

  • dims::Nothing=nothing: Grid dimensions (rows, cols). If nothing, calculates best square-ish grid

  • colormap::Symbol=jet: Colormap for the topography

  • time_unit::Symbol=s: Time unit for display labels (😒 or :ms). Only affects title strings — all intervals and selections remain in seconds.

  • colorbar_ticklabelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar ticklabelsize parameter

  • colorbar_rightspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar rightspinecolor parameter

  • colorbar_labelpadding::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar labelpadding parameter

  • colorbar_spinewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar spinewidth parameter

  • colorbar_bottomspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar bottomspinevisible parameter

  • component_selection::EegFun.var"#components##0#components##1"=#components##0: Function that returns boolean vector for component filtering

  • colorbar_ticklabelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar ticklabelcolor parameter

  • use_global_scale::Bool=false: Do multiple ICA topoplots share the same color scale based on min/max across all components?

  • point_marker::Symbol=circle: Marker style for electrode points.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • colorbar_tickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar tickwidth parameter

  • display_plot::Bool=true: Whether to display the plot

  • interactive::Bool=true: Whether to enable interactive features

  • colorbar_tickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar tickalign parameter

  • colorbar_ticklabelpad::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar ticklabelpad parameter

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • colorbar_labelrotation::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar labelrotation parameter

  • colorbar_ticklabelsvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticklabelsvisible parameter

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Float64=1.0: Radius of the head shape in mm.

  • title_fontsize::Int64=16: Font size for the title

  • colorbar_topspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar topspinevisible parameter

  • head_color::Symbol=black: Color of the head shape outline.

  • colorbar_minorticksize::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar minorticksize parameter

  • colorbar_tickformat::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar tickformat parameter

  • label_fontsize::Int64=20: Font size for electrode labels.

  • colorbar_ticklabelrotation::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar ticklabelrotation parameter

  • colorbar_rightspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar rightspinevisible parameter

  • colorbar_labelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar labelsize parameter

  • colorbar_bottomspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar bottomspinecolor parameter

  • label_color::Symbol=black: Color of electrode labels.

  • colorbar_minorticks::Observables.Observable{Any}=Observable{Any}(Makie.IntervalsBetween(5, true)): Colorbar minorticks parameter

  • colorbar_minortickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar minortickalign parameter

  • highlight_channels::Nothing=nothing: Highlight channel groups as a NamedTuple or Vector of NamedTuples. Each group: (channels=[:Cz, :Pz], color=:white, size=8, marker=:circle)

  • colorbar_ticks::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticks parameter

  • colorbar_ticklabelalign::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelalign parameter

  • colorbar_highclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar highclip parameter

  • colorbar_tickcolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar tickcolor parameter

  • colorbar_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar height parameter

  • colorbar_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar labelfont parameter

Examples

julia
plot_topography("grand_average_erps_good.jld2")
plot_topography("erps_good")
plot_topography("erps_good", participant_selection = participants(1))
source
EegFun.plot_topography Method

Create a multi-panel topographic plot for a vector of datasets, one subplot per condition.

source
EegFun.plot_topography Method

Plot a single epoch from each EpochData in the vector.

source
EegFun.plot_topography Method

Average epochs per condition, then delegate to the Vector{ErpData} topography method.

source
EegFun.plot_topography_stats Method
julia
plot_topography_stats(result::StatsResult;
                 n_topos::Int = 10,
                 interval_selection::Interval = times(),
                 topo_data::Symbol = :tvalues,
                 highlight_significant::Bool = true,
                 highlight_color = :white,
                 highlight_marker::Symbol = :circle,
                 highlight_size::Real = 8,
                 highlight_threshold::Real = 0.5,
                 kwargs...)

Plot a grid of topographic maps showing statistical results across time windows.

Each panel shows the spatial distribution of t-statistics (or difference amplitudes) averaged within a time window, with significant channels highlighted as markers.

Arguments

  • result::StatsResult: Results from analytic_test or permutation_test

  • n_topos::Int: Number of topographic panels (default: 10)

  • interval_selection::Interval: Time window to display (default: full range). Use times(start, stop) to specify

  • topo_data::Symbol: What to display on the topographic maps:

    • :tvalues (default) — t-statistics from the statistical test

    • :difference — difference wave amplitude (condition A − condition B)

  • highlight_significant::Bool: Whether to overlay markers on significant channels (default: true)

  • highlight_color: Color for significance markers (default: :white)

  • highlight_marker::Symbol: Marker symbol for significant channels (default: :circle). Options: :circle, :cross, :diamond, :star5, :xcross, :utriangle, :dtriangle, etc.

  • highlight_size::Real: Size of significance markers (default: 8)

  • highlight_threshold::Real: Proportion of time points within a window that must be significant to mark a channel (default: 0.5). 0.0 = any single time point (union), 0.5 = majority, 1.0 = all time points (intersection)

Additional keyword arguments from PLOT_TOPOGRAPHY_KWARGS are supported:

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • colorbar_nsteps::Observables.Observable{Any}=Observable{Any}(100): Colorbar nsteps parameter

  • colorbar_leftspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar leftspinevisible parameter

  • colorbar_limits::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar limits parameter

  • point_markersize::Int64=12: Size of electrode point markers.

  • colorbar_size::Observables.Observable{Any}=Observable{Any}(12): Colorbar size parameter

  • colorbar_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Colorbar alignmode parameter

  • colorbar_topspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar topspinecolor parameter

  • colorbar_plot_numbers::Vector{Any}=Any[]: Plot indices for which to show colorbars. Empty list shows colorbars for all plots.

  • colorbar_ticksize::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar ticksize parameter

  • colorbar_minortickcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar minortickcolor parameter

  • colorbar_halign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar halign parameter

  • colorbar_ticksvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticksvisible parameter

  • colorbar_tellheight::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellheight parameter

  • colorbar_vertical::Observables.Observable{Any}=Observable{Any}(true): Colorbar vertical parameter

  • colorbar_ticklabelspace::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelspace parameter

  • colorbar_ticklabelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar ticklabelfont parameter

  • colorbar_minortickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar minortickwidth parameter

  • colorbar_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar width parameter

  • colorbar_leftspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar leftspinecolor parameter

  • show_title::Bool=true: Whether to show the title

  • colorbar_colorrange::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar colorrange parameter

  • colorbar_plot::Bool=true: Whether to display the colorbar

  • colorbar_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar labelcolor parameter

  • num_levels::Int64=20: Number of contour levels (for ICA plots). For standard plots, use ylim instead.

  • gridscale::Int64=75: Grid resolution for interpolation

  • ylim::Nothing=nothing: Y-axis limits (nothing for auto). For ICA plots, use num_levels instead.

  • method::Symbol=thin_plate: Interpolation method: :multiquadratic, :inverse_multiquadratic, :gaussian, :inverse_quadratic, :thin_plate, :polyharmonic, :shepard, :nearest, :spherical_spline. See https://eljungsk.github.io/ScatteredInterpolation.jl/dev/methods/ for details on methods.

  • colorbar_minorticksvisible::Observables.Observable{Any}=Observable{Any}(false): Colorbar minorticksvisible parameter

  • colorbar_valign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar valign parameter

  • figure_title::String=Topography Plot: Title for the plot window

  • title::String=: Plot title

  • colorbar_label::String=μV: Label for the colorbar

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • colorbar_colormap::Observables.Observable{Any}=Observable{Any}(:viridis): Colorbar colormap parameter

  • colorbar_flip_vertical_label::Observables.Observable{Any}=Observable{Any}(false): Colorbar flip_vertical_label parameter

  • point_color::Symbol=black: Color of electrode points.

  • colorbar_lowclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar lowclip parameter

  • colorbar_scale::Observables.Observable{Any}=Observable{Any}(identity): Colorbar scale parameter

  • colorbar_flipaxis::Observables.Observable{Any}=Observable{Any}(true): Colorbar flipaxis parameter

  • colorbar_tellwidth::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellwidth parameter

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Colorbar position as (row, col) tuple, or :right, :below

  • colorbar_labelvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar labelvisible parameter

  • dims::Nothing=nothing: Grid dimensions (rows, cols). If nothing, calculates best square-ish grid

  • colormap::Symbol=jet: Colormap for the topography

  • time_unit::Symbol=s: Time unit for display labels (😒 or :ms). Only affects title strings — all intervals and selections remain in seconds.

  • colorbar_ticklabelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar ticklabelsize parameter

  • colorbar_rightspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar rightspinecolor parameter

  • colorbar_labelpadding::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar labelpadding parameter

  • colorbar_spinewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar spinewidth parameter

  • colorbar_bottomspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar bottomspinevisible parameter

  • component_selection::EegFun.var"#components##0#components##1"=#components##0: Function that returns boolean vector for component filtering

  • colorbar_ticklabelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar ticklabelcolor parameter

  • use_global_scale::Bool=false: Do multiple ICA topoplots share the same color scale based on min/max across all components?

  • point_marker::Symbol=circle: Marker style for electrode points.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • colorbar_tickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar tickwidth parameter

  • display_plot::Bool=true: Whether to display the plot

  • interactive::Bool=true: Whether to enable interactive features

  • colorbar_tickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar tickalign parameter

  • colorbar_ticklabelpad::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar ticklabelpad parameter

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • colorbar_labelrotation::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar labelrotation parameter

  • colorbar_ticklabelsvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticklabelsvisible parameter

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Float64=1.0: Radius of the head shape in mm.

  • title_fontsize::Int64=16: Font size for the title

  • colorbar_topspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar topspinevisible parameter

  • head_color::Symbol=black: Color of the head shape outline.

  • colorbar_minorticksize::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar minorticksize parameter

  • colorbar_tickformat::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar tickformat parameter

  • label_fontsize::Int64=20: Font size for electrode labels.

  • colorbar_ticklabelrotation::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar ticklabelrotation parameter

  • colorbar_rightspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar rightspinevisible parameter

  • colorbar_labelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar labelsize parameter

  • colorbar_bottomspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar bottomspinecolor parameter

  • label_color::Symbol=black: Color of electrode labels.

  • colorbar_minorticks::Observables.Observable{Any}=Observable{Any}(Makie.IntervalsBetween(5, true)): Colorbar minorticks parameter

  • colorbar_minortickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar minortickalign parameter

  • highlight_channels::Nothing=nothing: Highlight channel groups as a NamedTuple or Vector of NamedTuples. Each group: (channels=[:Cz, :Pz], color=:white, size=8, marker=:circle)

  • colorbar_ticks::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticks parameter

  • colorbar_ticklabelalign::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelalign parameter

  • colorbar_highclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar highclip parameter

  • colorbar_tickcolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar tickcolor parameter

  • colorbar_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar height parameter

  • colorbar_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar labelfont parameter

Returns

  • Named tuple (fig, axes, colorbar)

Examples

julia
# Basic usage with analytic test
result = analytic_test(prepared, correction_method=:no)
plot_topography_stats(result)

# Show difference wave amplitudes instead of t-values
plot_topography_stats(result, topo_data=:difference)

# Focus on a specific time window with more panels
plot_topography_stats(result, interval_selection=times(0.1, 0.4), n_topos=15)

# Custom marker style for significant channels
plot_topography_stats(result, highlight_marker=:star5, highlight_color=:yellow, highlight_size=12)
source
EegFun.plot_topography_stats Method
julia
plot_topography_stats(result::TFStatsResult;
                 freq_range::Tuple{Real, Real},
                 n_topos::Int = 10,
                 interval_selection::Interval = times(),
                 topo_data::Symbol = :tvalues,
                 highlight_significant::Bool = true,
                 highlight_color = :white,
                 highlight_marker::Symbol = :circle,
                 highlight_size::Real = 8,
                 highlight_threshold::Real = 0.5,
                 kwargs...)

Plot a grid of topographic maps from TF statistical results across time windows for a selected frequency band.

Each panel shows the spatial distribution of t-statistics (or power difference) averaged within a time window and frequency band, with significant channels highlighted.

A channel is marked significant when the proportion of significant time×frequency bins within the panel's window meets or exceeds highlight_threshold.

Arguments

  • result::TFStatsResult: TF statistical result (from permutation_test or analytic_test)

  • freq_range::Tuple{Real, Real}: Frequency range to average over (e.g., (8.0, 12.0))

  • n_topos::Int: Number of topographic panels (default: 10)

  • interval_selection::Interval: Time window to display (default: full range). Use times(start, stop) to specify

  • topo_data::Symbol: :tvalues (default) or :difference

  • highlight_significant::Bool: Overlay markers on significant channels (default: true)

  • highlight_threshold::Real: Proportion of time×freq bins that must be significant to mark a channel (default: 0.5). 0.0 = any bin, 1.0 = all bins

  • highlight_color, highlight_marker, highlight_size: Marker styling

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • point_plot::Bool=true: Whether to plot electrode points.

  • colorbar_nsteps::Observables.Observable{Any}=Observable{Any}(100): Colorbar nsteps parameter

  • colorbar_leftspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar leftspinevisible parameter

  • colorbar_limits::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar limits parameter

  • point_markersize::Int64=12: Size of electrode point markers.

  • colorbar_size::Observables.Observable{Any}=Observable{Any}(12): Colorbar size parameter

  • colorbar_alignmode::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Inside()): Colorbar alignmode parameter

  • colorbar_topspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar topspinecolor parameter

  • colorbar_plot_numbers::Vector{Any}=Any[]: Plot indices for which to show colorbars. Empty list shows colorbars for all plots.

  • colorbar_ticksize::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar ticksize parameter

  • colorbar_minortickcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar minortickcolor parameter

  • colorbar_halign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar halign parameter

  • colorbar_ticksvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticksvisible parameter

  • colorbar_tellheight::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellheight parameter

  • colorbar_vertical::Observables.Observable{Any}=Observable{Any}(true): Colorbar vertical parameter

  • colorbar_ticklabelspace::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelspace parameter

  • colorbar_ticklabelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar ticklabelfont parameter

  • colorbar_minortickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar minortickwidth parameter

  • colorbar_width::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar width parameter

  • colorbar_leftspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar leftspinecolor parameter

  • show_title::Bool=true: Whether to show the title

  • colorbar_colorrange::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar colorrange parameter

  • colorbar_plot::Bool=true: Whether to display the colorbar

  • colorbar_labelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar labelcolor parameter

  • num_levels::Int64=20: Number of contour levels (for ICA plots). For standard plots, use ylim instead.

  • gridscale::Int64=75: Grid resolution for interpolation

  • ylim::Nothing=nothing: Y-axis limits (nothing for auto). For ICA plots, use num_levels instead.

  • method::Symbol=thin_plate: Interpolation method: :multiquadratic, :inverse_multiquadratic, :gaussian, :inverse_quadratic, :thin_plate, :polyharmonic, :shepard, :nearest, :spherical_spline. See https://eljungsk.github.io/ScatteredInterpolation.jl/dev/methods/ for details on methods.

  • colorbar_minorticksvisible::Observables.Observable{Any}=Observable{Any}(false): Colorbar minorticksvisible parameter

  • colorbar_valign::Observables.Observable{Any}=Observable{Any}(:center): Colorbar valign parameter

  • figure_title::String=Topography Plot: Title for the plot window

  • title::String=: Plot title

  • colorbar_label::String=μV: Label for the colorbar

  • label_xoffset::Int64=0: X-axis offset for electrode labels.

  • colorbar_colormap::Observables.Observable{Any}=Observable{Any}(:viridis): Colorbar colormap parameter

  • colorbar_flip_vertical_label::Observables.Observable{Any}=Observable{Any}(false): Colorbar flip_vertical_label parameter

  • point_color::Symbol=black: Color of electrode points.

  • colorbar_lowclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar lowclip parameter

  • colorbar_scale::Observables.Observable{Any}=Observable{Any}(identity): Colorbar scale parameter

  • colorbar_flipaxis::Observables.Observable{Any}=Observable{Any}(true): Colorbar flipaxis parameter

  • colorbar_tellwidth::Observables.Observable{Any}=Observable{Any}(true): Colorbar tellwidth parameter

  • colorbar_position::Tuple{Int64, Int64}=(1, 2): Colorbar position as (row, col) tuple, or :right, :below

  • colorbar_labelvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar labelvisible parameter

  • dims::Nothing=nothing: Grid dimensions (rows, cols). If nothing, calculates best square-ish grid

  • colormap::Symbol=jet: Colormap for the topography

  • time_unit::Symbol=s: Time unit for display labels (😒 or :ms). Only affects title strings — all intervals and selections remain in seconds.

  • colorbar_ticklabelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar ticklabelsize parameter

  • colorbar_rightspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar rightspinecolor parameter

  • colorbar_labelpadding::Observables.Observable{Any}=Observable{Any}(5.0f0): Colorbar labelpadding parameter

  • colorbar_spinewidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar spinewidth parameter

  • colorbar_bottomspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar bottomspinevisible parameter

  • component_selection::EegFun.var"#components##0#components##1"=#components##0: Function that returns boolean vector for component filtering

  • colorbar_ticklabelcolor::Observables.Observable{Any}=Observable{Any}(:black): Colorbar ticklabelcolor parameter

  • use_global_scale::Bool=false: Do multiple ICA topoplots share the same color scale based on min/max across all components?

  • point_marker::Symbol=circle: Marker style for electrode points.

  • label_plot::Bool=true: Whether to plot electrode labels.

  • colorbar_tickwidth::Observables.Observable{Any}=Observable{Any}(1.0f0): Colorbar tickwidth parameter

  • display_plot::Bool=true: Whether to display the plot

  • interactive::Bool=true: Whether to enable interactive features

  • colorbar_tickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar tickalign parameter

  • colorbar_ticklabelpad::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar ticklabelpad parameter

  • label_yoffset::Int64=0: Y-axis offset for electrode labels.

  • colorbar_labelrotation::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar labelrotation parameter

  • colorbar_ticklabelsvisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar ticklabelsvisible parameter

  • head_linewidth::Int64=2: Line width of the head shape outline.

  • head_radius::Float64=1.0: Radius of the head shape in mm.

  • title_fontsize::Int64=16: Font size for the title

  • colorbar_topspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar topspinevisible parameter

  • head_color::Symbol=black: Color of the head shape outline.

  • colorbar_minorticksize::Observables.Observable{Any}=Observable{Any}(3.0f0): Colorbar minorticksize parameter

  • colorbar_tickformat::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar tickformat parameter

  • label_fontsize::Int64=20: Font size for electrode labels.

  • colorbar_ticklabelrotation::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar ticklabelrotation parameter

  • colorbar_rightspinevisible::Observables.Observable{Any}=Observable{Any}(true): Colorbar rightspinevisible parameter

  • colorbar_labelsize::Observables.Observable{Any}=Observable{Any}(14): Colorbar labelsize parameter

  • colorbar_bottomspinecolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar bottomspinecolor parameter

  • label_color::Symbol=black: Color of electrode labels.

  • colorbar_minorticks::Observables.Observable{Any}=Observable{Any}(Makie.IntervalsBetween(5, true)): Colorbar minorticks parameter

  • colorbar_minortickalign::Observables.Observable{Any}=Observable{Any}(0.0f0): Colorbar minortickalign parameter

  • highlight_channels::Nothing=nothing: Highlight channel groups as a NamedTuple or Vector of NamedTuples. Each group: (channels=[:Cz, :Pz], color=:white, size=8, marker=:circle)

  • colorbar_ticks::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticks parameter

  • colorbar_ticklabelalign::Observables.Observable{Any}=Observable{Any}(Makie.Automatic()): Colorbar ticklabelalign parameter

  • colorbar_highclip::Observables.Observable{Any}=Observable{Any}(nothing): Colorbar highclip parameter

  • colorbar_tickcolor::Observables.Observable{Any}=Observable{Any}(RGB{Float32}(0.0, 0.0, 0.0)): Colorbar tickcolor parameter

  • colorbar_height::Observables.Observable{Any}=Observable{Any}(GridLayoutBase.Auto(true, 1.0f0)): Colorbar height parameter

  • colorbar_labelfont::Observables.Observable{Any}=Observable{Any}(:regular): Colorbar labelfont parameter

Returns

  • Named tuple (fig, axes, colorbar)

Examples

julia
# Alpha-band statistics
plot_topography_stats(result, freq_range=(8.0, 12.0))

# Theta-band with more panels and lower threshold
plot_topography_stats(result, freq_range=(4.0, 7.0), n_topos=15, highlight_threshold=0.3)

# Specific time window
plot_topography_stats(result, freq_range=(8.0, 12.0), interval_selection=times(0.1, 0.5))
source
EegFun.plot_trigger_overview Method
julia
plot_trigger_overview(trigger_times, trigger_values, trigger_count)

Plot trigger events as a scatter plot with vertical lines.

Arguments

  • trigger_times: Vector of times when triggers occurred

  • trigger_values: Vector of trigger values at those times

  • trigger_count: OrderedDict mapping trigger values to their counts

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • y_min_limit::Float64=-0.1: Minimum y-axis limit.

  • linewidth_trigger::Int64=1: Line width for trigger vertical lines.

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • min_window_size::Float64=0.1: Minimum size of the time interval in seconds.

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • label_fontsize::Int64=20: Font size for labels.

  • initial_position::Float64=-2.0: Initial position of the time interval in seconds.

  • window_size::Float64=10.0: Size of the time window to display in seconds.

  • max_window_size::Float64=100.0: Maximum size of the time interval in seconds.

  • ignore_triggers::Vector{Int64}=Int64[]: Vector of trigger codes to ignore.

  • y_max_limit::Float64=0.15: Maximum y-axis limit.

  • timeline_width::Int64=2: Line width for the main timeline.

  • marker_size::Int64=15: Size of markers in the trigger overview plot.

  • line_offset::Float64=0.1: Offset for trigger vertical lines.

  • display_plot::Bool=true: Whether to display the plot.

  • event_line_height::Float64=0.05: Height of event lines.

  • event_line_width::Int64=1: Line width for individual event lines.

  • time_label_offset::Float64=-0.001: Vertical offset for time labels.

  • window_size_step::Float64=1.0: Step size for window size slider.

  • ygrid::Bool=false: Whether to show y-axis grid

  • position_step::Float64=0.5: Step size for position slider.

  • font_size::Int64=24: Font size for text elements.

  • xgrid::Bool=false: Whether to show x-axis grid

Returns

  • fig: The Makie Figure object

  • ax: The Axis object containing the plot

source
EegFun.plot_trigger_timing Method
julia
plot_trigger_timing(dat::ContinuousData; kwargs...)

Plot trigger timing with interactive x-axis sliders for scrolling and window size.

Arguments

  • dat::ContinuousData: The ContinuousData object containing the triggers

  • ignore_triggers: Vector of trigger codes to ignore (optional)

  • Other plotting parameters (window_size, display_plot, etc.)

Keyword Arguments

All keyword arguments below have sensible defaults. You can override any by passing the corresponding keyword argument.

  • y_min_limit::Float64=-0.1: Minimum y-axis limit.

  • linewidth_trigger::Int64=1: Line width for trigger vertical lines.

  • yminorgrid::Bool=false: Whether to show y-axis minor grid

  • min_window_size::Float64=0.1: Minimum size of the time interval in seconds.

  • xminorgrid::Bool=false: Whether to show x-axis minor grid

  • label_fontsize::Int64=20: Font size for labels.

  • initial_position::Float64=-2.0: Initial position of the time interval in seconds.

  • window_size::Float64=10.0: Size of the time window to display in seconds.

  • max_window_size::Float64=100.0: Maximum size of the time interval in seconds.

  • ignore_triggers::Vector{Int64}=Int64[]: Vector of trigger codes to ignore.

  • y_max_limit::Float64=0.15: Maximum y-axis limit.

  • timeline_width::Int64=2: Line width for the main timeline.

  • marker_size::Int64=15: Size of markers in the trigger overview plot.

  • line_offset::Float64=0.1: Offset for trigger vertical lines.

  • display_plot::Bool=true: Whether to display the plot.

  • event_line_height::Float64=0.05: Height of event lines.

  • event_line_width::Int64=1: Line width for individual event lines.

  • time_label_offset::Float64=-0.001: Vertical offset for time labels.

  • window_size_step::Float64=1.0: Step size for window size slider.

  • ygrid::Bool=false: Whether to show y-axis grid

  • position_step::Float64=0.5: Step size for position slider.

  • font_size::Int64=24: Font size for text elements.

  • xgrid::Bool=false: Whether to show x-axis grid

Returns

  • fig::Figure: The Makie figure object

  • ax::Axis: The Makie axis object

Example

julia
# Plot all triggers
fig, ax = plot_trigger_timing(dat)

# Ignore specific trigger codes
fig, ax = plot_trigger_timing(dat; ignore_triggers=[1, 255])
source