diff --git a/src/plot_erp.jl b/src/plot_erp.jl index 5aaea6e89..4685961b6 100644 --- a/src/plot_erp.jl +++ b/src/plot_erp.jl @@ -131,11 +131,12 @@ function plot_erp!(f::Union{GridPosition,Figure}, plotData::DataFrame; positions # add topoLegend if (config.extra.topoLegend) - topoAxis = Axis(f_grid, width=Relative(0.25), height=Relative(0.25), halign=0.05, valign=0.95, aspect=1) + topoAxis = Axis(f_grid, width=Relative(config.extra.topowidth), height=Relative(config.extra.topoheigth), halign=0.05, valign=0.95, aspect=1) topoplotLegend(config, topoAxis, allPositions) end # no extra legend mainAxis = Axis(f_grid; config.axis...) + hidedecorations!(mainAxis, label = false, ticks = false, ticklabels = false) if isnothing(colors) drawing = draw!(mainAxis, plotEquation) @@ -184,7 +185,7 @@ function topoplotLegend(config, axis, allPositions) colorrange=(0, length(allPositions)), # add the 0 for the white-first color colormap=specialColors, head=(color=:black, linewidth=1, model=topoMatrix), - label_scatter=(markersize=10, strokewidth=0.5,)) + label_scatter=(markersize=config.extra.markersize, strokewidth=0.5,)) hidedecorations!(current_axis()) hidespines!(current_axis()) diff --git a/src/plotconfig.jl b/src/plotconfig.jl index 865ff9ca4..3c677aba2 100644 --- a/src/plotconfig.jl +++ b/src/plotconfig.jl @@ -173,6 +173,9 @@ function PlotConfig(T::Val{:butterfly}) showLegend=false ), extra=(; topoLegend=true, + markersize=10, + topowidth=0.25, + topoheigth=0.25, topoPositionToColorFunction=x -> posToColorRomaO(x) ), mapping=(; color=(:channel, :channels, :trial, :trials,), diff --git a/test/Project.toml b/test/Project.toml index d771c941d..56a844000 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -4,4 +4,5 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TopoPlots = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a" +Unfold = "181c99d8-e21b-4ff3-b70b-c233eddec679" UnfoldSim = "ed8ae6d2-84d3-44c6-ab46-0baf21700804" diff --git a/test/setup.jl b/test/setup.jl index 9063fd0db..1fb043909 100644 --- a/test/setup.jl +++ b/test/setup.jl @@ -4,4 +4,6 @@ using Test using CairoMakie using GeometryBasics using DataFrames -using TopoPlots \ No newline at end of file +using TopoPlots + +include("../docs/example_data.jl") \ No newline at end of file diff --git a/test/test_butterfly.jl b/test/test_butterfly.jl new file mode 100644 index 000000000..26d24c757 --- /dev/null +++ b/test/test_butterfly.jl @@ -0,0 +1,6 @@ + +@testset "markersize change" begin + include("example_data.jl") + data, pos = example_data("TopoPlots.jl") + plot_butterfly(data; positions=pos, extra=(markersize = 10, topoheigth=0.4, topowidth=0.4)) +end diff --git a/test/test_topoplot.jl b/test/test_topoplot.jl index 261258242..4dfefb76b 100644 --- a/test/test_topoplot.jl +++ b/test/test_topoplot.jl @@ -1,4 +1,3 @@ -include("setup.jl") @testset "testing topoplot" begin data, positions = TopoPlots.example_data() plot_topoplot(data[:, 150, 1]; positions=positions, t=150) diff --git a/test/test_toposeries.jl b/test/test_toposeries.jl index 2d1e99d60..324df5148 100644 --- a/test/test_toposeries.jl +++ b/test/test_toposeries.jl @@ -1,5 +1,4 @@ -# include("../UnfoldMakie/test/test_toposeries.jl") -#include("setup.jl") + @testset "testing calculateBBox" begin data, positions = TopoPlots.example_data() df = UnfoldMakie.eeg_matrix_to_dataframe(data[:, :, 1], string.(1:length(positions)));