unfoldtoolbox / UnfoldMakie.jl

Plotting tools for Unfold.jl based on Makie.jl and AlgebraOfGraphics.jl
MIT License
15 stars 7 forks source link

plot_erpimage doesn't work with NaN values #158

Open vladdez opened 3 months ago

vladdez commented 3 months ago

We need to teach it to handle nan values: write an error or process them somehow. Code below could be used for current problem solving.

begin
    indices_notnan = findall(<(1), isnan.(evts.sac_amplitude)) # find indices where events.column is not NaN
    f = Figure()
    plot_erpimage!(
            f[1, 1],
            dat[:, indices_notnan];  # only rows of dat where evts.column is not NaN
            sortvalues = evts[indices_notnan, :].sac_amplitude,
            axis = (; title = "One-sided fan; sorted by duration"),
        )
    f
end