unfoldtoolbox / UnfoldMakie.jl

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

Indicator topoplot #147

Open behinger opened 5 months ago

behinger commented 5 months ago

I had trouble to generate such a plot with plot_topoplot

grafik

And that plot is ugly. I now used TopoPlots directly.

    d = zeros(128)
    d[ch_ix] = 10
    #UnfoldMakie.eeg_matrix_to_dataframe(d,1:128)

UnfoldMakie.eeg_topoplot(d;positions=pos,interpolation=UnfoldMakie.TopoPlots.NullInterpolator(),        label_scatter=(;markersize=20)
)

it should be super easy to make this plot, maybe even an extra unfoldMakie function - do you remember that I asked you to make that plot clickable and it returns an observable? That would do the trick here perfectly and would be very convenient

behinger commented 5 months ago

Probably I could improve it by providing a better colormap - but yeah I was annoyed I couldnt put a non-dataframe into plot_topoplot in the first place :/

vladdez commented 5 months ago

as I understand the clickability is the main feature here, right?

behinger commented 5 months ago

for me is having a convenient indicator topoplot function

edit: it shold be white with a e.g. red dot o.c.

behinger commented 3 weeks ago
begin
    function topoplot_indicator!(f,ix)
x = zeros(128)
    x[ix] =1
    clist = [:gray,:darkred][Int.(x.+1)]
        ax = f[1,1] = Axis(f, width = Relative(0.4),
            height = Relative(0.4),
            halign = 1.2,
            valign = 1,aspect=1)
UnfoldMakie.TopoPlots.eeg_topoplot!(ax, x; positions=pos, enlarge=0.9,label_scatter=(;color=clist,markersize=((x.+0.25).*40)./5,strokewidth=0),interpolation=UnfoldMakie.TopoPlots.NullInterpolator())
        hidespines!(ax)
        hidedecorations!(ax)
    end

end
behinger commented 3 weeks ago

grafik