diff --git a/src/plot_circulareegtopoplot.jl b/src/plot_circulareegtopoplot.jl index 5c5f66c6c..2a303e552 100644 --- a/src/plot_circulareegtopoplot.jl +++ b/src/plot_circulareegtopoplot.jl @@ -7,7 +7,7 @@ Plot a circular EEG topoplot. - `f::Union{GridPosition, GridLayout, Figure}`: Figure, GridLayout or GridPosition that the plot should be drawn into - `data::DataFrame`: DataFrame with keys for data (looks for `:y, :yhat, :estimate`), and :position (looks for `:pos, :position, :positions`), -- `predictor` (optional; default :predictor): the circular predictor value, defines position of topoplot, is mapped around `predictor_bounds` +- `predictor` (optional; default: predictor): the circular predictor value, defines position of topoplot, is mapped around `predictor_bounds` - `predictor_bounds` (default: `[0,360]`): the bounds of the predictor. This is relevant for the axis labels. - `positions` (default: nothing): positions for the [`plot_topoplot`](@Ref) - `center_label` (default: ""): the text in the center of the cricle diff --git a/src/plot_parallelcoordinates.jl b/src/plot_parallelcoordinates.jl index 566432e45..3d23dc066 100644 --- a/src/plot_parallelcoordinates.jl +++ b/src/plot_parallelcoordinates.jl @@ -1,23 +1,23 @@ """ - plot_parallelcoordinates!(f::Union{GridPosition, GridLayout, Figure}, + ?\(f::Union{GridPosition, GridLayout, Figure}, data::DataFrame, config::PlotConfig; channels::Vector{Int64}) Plot a PCP (parallel coordinates plot). ## Arguments: -- `f::Union{GridPosition, GridLayout, Figure}`: Figure or GridPosition that the plot should be drawn into -- `data::DataFrame`: Data for the plot visualization. -- `config::PlotConfig`: Instance of PlotConfig being applied to the visualization. +- `f::Union{GridPosition, GridLayout, Figure}`: Figure or GridPosition that the plot should be drawn into. +- `data::DataFrame`: data for the plot visualization. +- `config::PlotConfig`: instance of PlotConfig being applied to the visualization. - `channels::Vector{Int64}`: vector with all the channels representing an axis used in the PCP in given order. PCP has problems with size changes of the view window. -By adapting the padding, aspect ratio and tick label size in px for a new use case, the PCP can even be added into a Coordinated Multiple Views System - -- `pc_aspect_ratio` Default : `0.55` -- `pc_right_padding` Default : `15` -- `pc_left_padding` Default : `25` -- `pc_top_padding` Default : `26` -- `pc_bottom_padding` Default : `16` -- `pc_tick_label_size` Default : `14` +By adapting the padding, aspect ratio and tick label size in px for a new use case, the PCP can even be added into a complex figures. + +- `pc_aspect_ratio` (default: `0.55`) - +- `pc_right_padding` (default: `15`) - +- `pc_left_padding` (default: `25`) - +- `pc_top_padding` (default: `26`) - +- `pc_bottom_padding` (default: `16`) - +- `pc_tick_label_size` (default: `14`) - $(_docstring(:paracoord)) diff --git a/src/plot_topoplot.jl b/src/plot_topoplot.jl index 5df7a5baa..24dceaccd 100644 --- a/src/plot_topoplot.jl +++ b/src/plot_topoplot.jl @@ -1,13 +1,13 @@ """ - plot_topoplot!(f::Union{GridPosition, GridLayout, Figure}, plotData, ; positions=nothing, labels=nothing,kwargs...) - plot_topoplot(plotData,; positions=nothing, labels=nothing, kwargs...) + plot_topoplot!(f::Union{GridPosition, GridLayout, Figure}, data, ; positions=nothing, labels=nothing,kwargs...) + plot_topoplot(data,; positions=nothing, labels=nothing, kwargs...) Plot a topo plot. ## Arguments: - `f::Union{GridPosition, GridLayout, Figure}`: Figure or GridPosition (e.g. f[2, 3]) that the plot should be drawn into. New axis is created. -- `plotData::Union{DataFrame, Vector{Float32}}`: Data for the plot visualization. -- `positions::Vector{Point{2, Float32}}=nothing`: positions used if `plotData` is no DataFrame. If this is the case and `positions=nothing` then positions is generated from `labels`. -- `labels::Vector{String}=nothing`: labels used if `plotData` is no DataFrame. +- `data::Union{DataFrame, Vector{Float32}}`: data for the plot visualization. +- `positions::Vector{Point{2, Float32}}=nothing`: positions used if `data` is not a DataFrame. If this is the case and `positions=nothing` then positions are generated from `labels`. +- `labels::Vector{String} = nothing`: labels used if `data` is not a DataFrame. $(_docstring(:topoplot)) @@ -16,11 +16,11 @@ $(_docstring(:topoplot)) ## Return Value: A figure displaying the topo plot. """ -plot_topoplot(plotData::Union{DataFrame,Vector{Float32}}; kwargs...) = - plot_topoplot!(Figure(), plotData; kwargs...) +plot_topoplot(data::Union{DataFrame,Vector{Float32}}; kwargs...) = + plot_topoplot!(Figure(), data; kwargs...) function plot_topoplot!( f::Union{GridPosition,GridLayout,Figure}, - plotData::Union{DataFrame,<:AbstractVector}; + data::Union{DataFrame,<:AbstractVector}; positions = nothing, labels = nothing, kwargs..., @@ -31,16 +31,16 @@ function plot_topoplot!( axis = Axis(f[1, 1]; config.axis...) - if !(plotData isa Vector) - config.mapping = resolveMappings(plotData, config.mapping) - plotData = plotData[:, config.mapping.y] + if !(data isa Vector) + config.mapping = resolveMappings(data, config.mapping) + data = data[:, config.mapping.y] end positions = getTopoPositions(; positions = positions, labels = labels) - eeg_topoplot!(axis, plotData, labels; positions, config.visual...) + eeg_topoplot!(axis, data, labels; positions, config.visual...) - clims = (min(plotData...), max(plotData...)) + clims = (min(data...), max(data...)) if clims[1] ≈ clims[2] @warn """The min and max of the value represented by the color are the same, it seems that the data values are identical. We disable the color bar in this figure.