From bece59e717c0ed1e0f7a9b3f68468f1e700da5b2 Mon Sep 17 00:00:00 2001 From: Benedikt Ehinger Date: Wed, 22 Nov 2023 09:58:06 +0100 Subject: [PATCH 1/3] Update plot_erp.jl --- src/plot_erp.jl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plot_erp.jl b/src/plot_erp.jl index 317b9fb79..e8a823291 100644 --- a/src/plot_erp.jl +++ b/src/plot_erp.jl @@ -21,7 +21,9 @@ Plot an ERP plot. - `stderror` (bool, `false`): add an error ribbon, with lower and upper limits based on the `:stderror` column. - `pvalue` (Array, `[]`): show a pvalue. - example: `DataFrame(from=[0.1, 0.3], to=[0.5, 0.7], coefname=["(Intercept)", "condition:face"])` - if coefname is not specified, the lines will be black - +- `positions` (nothing): see plot_butterfly. +Internal: +- `butterfly` (bool, `true`): a butterfly plot. $(_docstring(:erp)) @@ -34,16 +36,18 @@ plot_erp(plot_data::DataFrame; kwargs...) = plot_erp!(Figure(), plot_data, ; kwa """ Plot a butterfly plot + plot_butterfly(plot_data::DataFrame; positions=nothing) = ## kwargs (...; ...): - -- `butterfly` (bool, `true`): create a butterfly plot. +- `positions` (bool, `nothing`): Provide 2D layout positions to add a inset based on channel location and color the lines in a logical way - `topolegend` (bool, `true`): show an inlay topoplot with corresponding electrodes. - `topomarkersize` (Real, `10`): change the size of the markers, topoplot-inlay electrodes. - `topowidth` (Real, `0.25`): change the size of the inlay topoplot width. - `topoheigth` (Real, `0.25`): change the size of the inlay topoplot height. - `topopositions_to_color` (function, ´x -> posToColorRomaO(x)´). + + $(_docstring(:butterfly)) see also [`plot_erp`](@Ref) """ From cb119ea679fbccf7c5fe3042454bed0302209d54 Mon Sep 17 00:00:00 2001 From: "behinger (s-ccs 001)" Date: Sun, 26 Nov 2023 18:57:07 +0000 Subject: [PATCH 2/3] better docs --- src/plot_erp.jl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plot_erp.jl b/src/plot_erp.jl index e8a823291..e866d41cf 100644 --- a/src/plot_erp.jl +++ b/src/plot_erp.jl @@ -17,13 +17,14 @@ Plot an ERP plot. - `categorical_color` (bool, `true`): in case of numeric `:color` column, treat `:color` as continuous or categorical variable. - `categorical_group` (bool, `true`): in case of numeric `:group` column, treat `:group` as categorical variable by default. -- `topolegend` (bool, `false`): add an inlay topoplot with corresponding electrodes. +- `topolegend` (bool, `false`): (see `plot_butterfly`) add an inlay topoplot with corresponding electrodes. Requires `positions` to be provided. - `stderror` (bool, `false`): add an error ribbon, with lower and upper limits based on the `:stderror` column. - `pvalue` (Array, `[]`): show a pvalue. - example: `DataFrame(from=[0.1, 0.3], to=[0.5, 0.7], coefname=["(Intercept)", "condition:face"])` - if coefname is not specified, the lines will be black - `positions` (nothing): see plot_butterfly. -Internal: -- `butterfly` (bool, `true`): a butterfly plot. + +Internal-use only: +- `butterfly` (bool, `true`): a butterfly plot instead of an ERP-plot. See `plot_butterfly` $(_docstring(:erp)) @@ -39,8 +40,8 @@ Plot a butterfly plot plot_butterfly(plot_data::DataFrame; positions=nothing) = ## kwargs (...; ...): -- `positions` (bool, `nothing`): Provide 2D layout positions to add a inset based on channel location and color the lines in a logical way -- `topolegend` (bool, `true`): show an inlay topoplot with corresponding electrodes. +- `positions` (bool, `nothing`): must be the same length as plot_data. If specified, adds an topoplot-inset-legend of the provided channel-positions. Changes to color of the channel-lines. Uses the `topoposition_to_color` function. +- `topolegend` (bool, `true`): show an inlay topoplot with corresponding electrodes. Requires `positions` to be provided - `topomarkersize` (Real, `10`): change the size of the markers, topoplot-inlay electrodes. - `topowidth` (Real, `0.25`): change the size of the inlay topoplot width. - `topoheigth` (Real, `0.25`): change the size of the inlay topoplot height. From a49acefa291304e4d452dc5d0509b90dff9cc26a Mon Sep 17 00:00:00 2001 From: Vladimir Mikheev <33777074+vladdez@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:16:29 +0000 Subject: [PATCH 3/3] Update plot_erp.jl added more consistency, couple of dots and removed a repetition. And "positions" should be Array not nothing, right? --- src/plot_erp.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plot_erp.jl b/src/plot_erp.jl index e866d41cf..9e84aca1c 100644 --- a/src/plot_erp.jl +++ b/src/plot_erp.jl @@ -17,11 +17,11 @@ Plot an ERP plot. - `categorical_color` (bool, `true`): in case of numeric `:color` column, treat `:color` as continuous or categorical variable. - `categorical_group` (bool, `true`): in case of numeric `:group` column, treat `:group` as categorical variable by default. -- `topolegend` (bool, `false`): (see `plot_butterfly`) add an inlay topoplot with corresponding electrodes. Requires `positions` to be provided. - `stderror` (bool, `false`): add an error ribbon, with lower and upper limits based on the `:stderror` column. - `pvalue` (Array, `[]`): show a pvalue. - - example: `DataFrame(from=[0.1, 0.3], to=[0.5, 0.7], coefname=["(Intercept)", "condition:face"])` - if coefname is not specified, the lines will be black -- `positions` (nothing): see plot_butterfly. + - example: `DataFrame(from=[0.1, 0.3], to=[0.5, 0.7], coefname=["(Intercept)", "condition:face"])` - if coefname is not specified, the lines will be black. +- `positions` (Array, `[]`): see plot_butterfly. +- `topolegend` (bool, `false`): (see `plot_butterfly`). Internal-use only: - `butterfly` (bool, `true`): a butterfly plot instead of an ERP-plot. See `plot_butterfly` @@ -40,12 +40,13 @@ Plot a butterfly plot plot_butterfly(plot_data::DataFrame; positions=nothing) = ## kwargs (...; ...): -- `positions` (bool, `nothing`): must be the same length as plot_data. If specified, adds an topoplot-inset-legend of the provided channel-positions. Changes to color of the channel-lines. Uses the `topoposition_to_color` function. -- `topolegend` (bool, `true`): show an inlay topoplot with corresponding electrodes. Requires `positions` to be provided +- `positions` (Array, `[]`): if specified, adds a topoplot as an inset legend to the provided channel positions. Must be the same length as `plot_data`. + To change the colors of the channel lines use the `topoposition_to_color` function. +- `topolegend` (bool, `true`): show an inlay topoplot with corresponding electrodes. Requires `positions` to be provided. - `topomarkersize` (Real, `10`): change the size of the markers, topoplot-inlay electrodes. - `topowidth` (Real, `0.25`): change the size of the inlay topoplot width. - `topoheigth` (Real, `0.25`): change the size of the inlay topoplot height. -- `topopositions_to_color` (function, ´x -> posToColorRomaO(x)´). +- `topopositions_to_color` (function, ´x -> posToColorRomaO(x)´): change the colors of the channel lines.