From 3d1b902650c2500bd3bceeb2b5fe793a7e09f6ec Mon Sep 17 00:00:00 2001 From: Vladimir Mikheev Date: Fri, 20 Sep 2024 20:51:55 +0000 Subject: [PATCH] minor changes in docs --- docs/literate/tutorials/erp.jl | 2 +- docs/literate/tutorials/topoplotseries.jl | 14 ++++++++++++-- src/plot_butterfly.jl | 3 ++- src/plot_topoplotseries.jl | 7 +------ test/test_toposeries1.jl | 4 ++++ 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/literate/tutorials/erp.jl b/docs/literate/tutorials/erp.jl index cd7cddb15..2491fa576 100644 --- a/docs/literate/tutorials/erp.jl +++ b/docs/literate/tutorials/erp.jl @@ -108,7 +108,7 @@ text!(0.98, 0.2, text = "* Confidence\nintervals", align = (:right, :top)) f # There are two ways to implement it. -# First is using `:stderror = true' after `;`. +# First is using `:stderror = true` after `;`. results.se_low = results.estimate .- 0.5 results.se_high = results.estimate .+ 0.15 diff --git a/docs/literate/tutorials/topoplotseries.jl b/docs/literate/tutorials/topoplotseries.jl index 9c12cb578..410b30735 100644 --- a/docs/literate/tutorials/topoplotseries.jl +++ b/docs/literate/tutorials/topoplotseries.jl @@ -25,11 +25,21 @@ nothing #hide # `bin_width` - specify the interval between topoplots bin_width = 80 -plot_topoplotseries(df; bin_width, positions = positions) +plot_topoplotseries( + df; + bin_width, + positions = positions, + axis = (; xlabel = "Time windows [s]"), +) # `bin_num` - specify the number of topoplots -plot_topoplotseries(df; bin_num = 5, positions = positions) +plot_topoplotseries( + df; + bin_num = 5, + positions = positions, + axis = (; xlabel = "Time windows [s]"), +) # # Categorical and contionous x-values # By deafult x-value is `time`, but it could be any contionous (i.g. saccade amplitude) or categorical (any experimental variable) value. diff --git a/src/plot_butterfly.jl b/src/plot_butterfly.jl index e26e6625d..783a99623 100644 --- a/src/plot_butterfly.jl +++ b/src/plot_butterfly.jl @@ -36,7 +36,8 @@ Plot a Butterfly plot. - `topo_axis.height::Real = 0.25` \\ Change the height of inlay topoplot. - `mapping = (;)`\\ - For highlighting specific channels. + For highlighting specific channels.\\ + Example: `mapping = (; color = :highlight))`, where `:highlight` is variable with appopriate mapping. **Return Value:** `Figure` displaying Butterfly plot. diff --git a/src/plot_topoplotseries.jl b/src/plot_topoplotseries.jl index 0c75455e5..dcdee3652 100644 --- a/src/plot_topoplotseries.jl +++ b/src/plot_topoplotseries.jl @@ -80,6 +80,7 @@ function plot_topoplotseries!( config = PlotConfig(:topoplotseries) # overwrite all defaults by user specified values config_kwargs!(config; kwargs...) + # resolve columns with data config.mapping = resolve_mappings(to_value(data), config.mapping) data_copy = deepcopy(to_value(data)) # deepcopy prevents overwriting initial data @@ -141,12 +142,6 @@ function plot_topoplotseries!( colorbar = (; colorrange = colorrange), ) - config_kwargs!( - config, - visual = (; colorrange = colorrange), - colorbar = (; colorrange = colorrange), - ) - ax = Axis( f[1, 1]; (p for p in pairs(config.axis) if p[1] != :xlim_topo && p[1] != :ylim_topo)..., diff --git a/test/test_toposeries1.jl b/test/test_toposeries1.jl index cdf981ef9..ead15dc40 100644 --- a/test/test_toposeries1.jl +++ b/test/test_toposeries1.jl @@ -12,6 +12,10 @@ end plot_topoplotseries(df; bin_num = 5, positions = positions) end +@testset "toposeries: bin_num" begin + plot_topoplotseries(df; bin_num = 5, positions = positions, axis = (; xlabel = "test")) +end + @testset "toposeries: checking other y value" begin df.cont = df.time .* 3 plot_topoplotseries(df; bin_num = 5, positions = positions, mapping = (; col = :cont))