Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it easier to create this figure #143

Closed
behinger opened this issue Jan 30, 2024 · 1 comment · Fixed by #204
Closed

make it easier to create this figure #143

behinger opened this issue Jan 30, 2024 · 1 comment · Fixed by #204
Labels
bug Something isn't working enhancement New feature or request

Comments

@behinger
Copy link
Member

Figure from @jschepers
grafik

coefs = coeftable(m)
coefnames = unique(coefs.coefname)

f = Figure(size = (1000, 400))
ga = f[1, 1] = GridLayout()
gb = f[1, 2] = GridLayout()

ax = Axis(
    ga[1, 1],
    title = "Estimated regression parameters",
    titlegap = 12,
    xlabel = "Time [s]",
    ylabel = "Amplitude [μV]",
    xlabelsize = 16,
    ylabelsize = 16,
    xgridvisible = false,
    ygridvisible = false,
)

for coef in coefnames
    estimate = filter(:coefname => ==(coef), coefs)
    lines!(ax, estimate.time, estimate.estimate, label = coef)
end
axislegend("Coefficient", framevisible = false)
hidespines!(ax, :t, :r)

f2 = plot_erp!(
    gb,
    effects(Dict(:condition => ["car", "face"], :continuous => -5:5), m);
    mapping = (; color = :continuous, linestyle = :condition, group = :continuous),
    legend = (; valign = :top, halign = :right, tellwidth = false),
    categorical_color = false,
    axis = (
        title = "Marginal effects",
        titlegap = 12,
        xlabel = "Time [s]",
        ylabel = "Amplitude [μV]",
        xlabelsize = 16,
        ylabelsize = 16,
        xgridvisible = false,
        ygridvisible = false,
    ),
    layout = (; showlegend = false),
);

# Workaround to separate legend and colorbar (will be fixed in a future UnfoldMakie version)
legend = f2.content[2].content
f2[:, 1] = legend

for (label, layout) in zip(["A", "B"], [ga, gb])
    Label(
        layout[1, 1, TopLeft()],
        label,
        fontsize = 26,
        font = :bold,
        padding = (0, 5, 5, 0),
        halign = :right,
    )
end
@vladdez vladdez added bug Something isn't working enhancement New feature or request labels Feb 15, 2024
@vladdez
Copy link
Collaborator

vladdez commented Jul 24, 2024

fixed in #204

@vladdez vladdez closed this as completed Jul 24, 2024
@vladdez vladdez mentioned this issue Jul 25, 2024
vladdez added a commit that referenced this issue Aug 7, 2024
Ploterp
- erp plot and butterfly codes separated into two files
- resolved #38 
- resolved #143 
- opportunity to disable colorbar and legend separately
- resolved #207 
- adjusted to AoG 0.8 version
- example of naked figure in docs
- #213 4 out of 8
- `eeg_matrix_to_dataframe` renamed to [eeg_array_to_dataframe](1136f22) and updated for new data inputs
- add `use_colorbar` and `use_legend` in `plot_erp`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants