Closed ReneSkukies closed 1 month ago
In case anyone runs into this problem: AoG (which is used for the plots by UnfoldMakie) seems to plot subplots in alphabetical order of the subplot name. Thus you can get around the issue by renaming the stimuli in your model.
For the example above, renaming stimuli to 'A' and 'R' would result in correctly plotted subplots.
we maybe accidentially fixed this :shrug:
using Unfold, AlgebraOfGraphics
data,evts = UnfoldSim.predef_eeg()
evts
m = fit(UnfoldModel,["car"=>(@formula(0~1+continuous),firbasis((-0.1,1),100)),"face"=>(@formula(0~1+continuous),firbasis((-0.1,1),100))],evts,data;eventcolumn=:condition)
eff = effects(Dict(:continuous => 75:20:300), m)
sorting = ["car","face"]
sorting = ["face","car"]
plot_erp(eff;
mapping = (; col = :eventname => sorter(sorting),
color = :continuous,group=:continuous)
)
works now
and
fixed #237
In AoG I can use the sorter function in case variables won't get sorted in the way I want (e.g. into subplots or inside a plot). Here is an example:
This gives me the following plot:
However, in UnfoldMakie the following does not work:
And without the sorting, the plot looks like this:
Is it possible to include sorting in UM? Or is there already a way for this?