From 3f31f6f20bc77d015e56c15407f0ed9510613c8f Mon Sep 17 00:00:00 2001 From: Vladimir Mikheev Date: Tue, 14 Nov 2023 13:54:33 +0000 Subject: [PATCH] revised topoplotseries and test all --- src/plot_topoplotseries.jl | 32 +++++++++++++------------------- src/plotconfig.jl | 4 ++-- test/test_all.jl | 18 ++++++++---------- test/test_erpimage.jl | 10 +++++++++- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/plot_topoplotseries.jl b/src/plot_topoplotseries.jl index 2758f05e6..8a667cf25 100644 --- a/src/plot_topoplotseries.jl +++ b/src/plot_topoplotseries.jl @@ -71,28 +71,22 @@ function plot_topoplotseries!( if config.layout.useColorbar if typeof(ftopo) == Figure d = ftopo.content[1].scene.plots[1] - Colorbar( - f[1, end+1], - colormap = d.colormap, - colorrange = d.colorrange, - height = config.colorbar.height, - flipaxis = config.colorbar.flipaxis, - labelrotation = config.colorbar.labelrotation, - label = config.colorbar.label, - ) + f_colorbar = f[1, end+1] + else - # println(fieldnames(typeof((axlist[1])))) + #@debug axlist + f_colorbar = f[:, :][1, length(axlist)+1] d = axlist[1].scene.plots[1].attributes - Colorbar( - f[:, :][1, length(axlist)+1], - colormap = d.colormap, - colorrange = d.colorrange, - height = config.colorbar.height, - flipaxis = config.colorbar.flipaxis, - labelrotation = config.colorbar.labelrotation, - label = config.colorbar.label, - ) end + Colorbar( + f_colorbar, + colormap = d.colormap, + colorrange = d.colorrange, + #height = config.colorbar.height, + flipaxis = config.colorbar.flipaxis, + labelrotation = config.colorbar.labelrotation, + label = config.colorbar.label, + ) end return f diff --git a/src/plotconfig.jl b/src/plotconfig.jl index addf46d35..7aebc8184 100644 --- a/src/plotconfig.jl +++ b/src/plotconfig.jl @@ -141,9 +141,9 @@ function PlotConfig(T::Val{:topoplotseries}) cfg, layout = (useColorbar = true,), colorbar = (; - height = 300, # why even should i made it manually? + #height = 300, flipaxis = true, - labelrotation = 4.7, + labelrotation = -π/2, label = "Voltage [µV]" ), visual = (; diff --git a/test/test_all.jl b/test/test_all.jl index 42e5637f0..789641483 100644 --- a/test/test_all.jl +++ b/test/test_all.jl @@ -1,14 +1,13 @@ @testset "8 plots" begin f = Figure(resolution=(1200, 1400)) - ga = f[1, 1] = GridLayout() - gc = f[2, 1] = GridLayout() - ge = f[3, 1] = GridLayout() - gg = f[4, 1] = GridLayout() - geh = f[1:4, 2] = GridLayout() - gb = geh[1, 1] = GridLayout() - gd = geh[2, 1] = GridLayout() - gf = geh[3, 1] = GridLayout() - gh = geh[4, 1] = GridLayout() + ga = f[1, 1] + gc = f[2, 1] + ge = f[3, 1] + gg = f[4, 1] + gb = f[1, 2] + gd = f[2, 2] + gf = f[3, 2] + gh = f[4, 2] include("../docs/example_data.jl") d_topo, pos = example_data("TopoPlots.jl") @@ -55,7 +54,6 @@ f end - @testset "8 plots with a Figure" begin f = Figure(resolution=(1200, 1400)) diff --git a/test/test_erpimage.jl b/test/test_erpimage.jl index fda7b0e6b..a09c94cb4 100644 --- a/test/test_erpimage.jl +++ b/test/test_erpimage.jl @@ -21,7 +21,15 @@ end #save("erpimage.eps", f) end - +@testset "testing better sorting" begin + using UnfoldSim + dat,evts = UnfoldSim.predef_eeg(;onset=LogNormalOnset(μ=3.5,σ=0.4),noiselevel=5) + dat_e,times = Unfold.epoch(dat,evts,[-0.1,1],100) + evts,dat_e = Unfold.dropMissingEpochs(evts,dat_e) + evts.Δlatency = diff(vcat(evts.latency,0)) + dat_e = dat_e[1,:,:] + plot_erpimage(times,dat_e;sortvalues=evts.Δlatency) +end #= @testset "testing better sorting" begin