diff --git a/docs/literate/tutorials/erp.jl b/docs/literate/tutorials/erp.jl index cd7cddb1..2491fa57 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 9c12cb57..410b3073 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 e26e6625..783a9962 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 0c75455e..dcdee365 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 cdf981ef..ead15dc4 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))