Skip to content

Makie.jl integration #171

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

Closed
cadojo opened this issue Sep 5, 2021 · 5 comments · Fixed by #236
Closed

Makie.jl integration #171

cadojo opened this issue Sep 5, 2021 · 5 comments · Fixed by #236
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cadojo
Copy link
Collaborator

cadojo commented Sep 5, 2021

Right now plotting functions and visualizations use Plots, which is great, but there should also be Makie integration.

@cadojo cadojo added enhancement New feature or request help wanted Extra attention is needed labels Oct 19, 2024
@icweaver
Copy link
Member

icweaver commented Feb 21, 2025

Howdy, are y'all still looking for some contributions to this? We've started some similar work over in JuliaAstro/DustExtinction.jl#58

@cadojo
Copy link
Collaborator Author

cadojo commented Feb 25, 2025

Hello! Yes thank you for reaching out, contributions are very much welcome! It might also be cool for us to come up with some base packages for us to share common types, plot recipes, etc.

@icweaver
Copy link
Member

icweaver commented Feb 26, 2025

Oh dope, looks like SciML already did this in SciML/SciMLBase.jl#611

Besides ensemble plots (SciML/SciMLBase.jl#697 (comment)), it looks like most things should work out of the box. I took a quick crack at translating the examples in https://github.com/JuliaAstro/GeneralAstrodynamics.jl/blob/main/lib/AstrodynamicalSolvers/docs/src/index.md for your review here:

https://icweaver.github.io/GeneralAstrodynamics.jl/notebook.html

Preview:

Plots.jl comparison

Image

figure = Pl.plot(; 
    aspect_ratio = 1.0,
    background = :transparent,
    grid = true,
    title = "Unstable and Stable Invariant Manifolds",
)
Pl.plot!(figure, unstable, idxs=(:x, :y), aspect_ratio=1, label=:none, palette=:blues)
Pl.plot!(figure, stable, idxs=(:x, :y), aspect_ratio=1, label=:none, palette=:blues)
Pl.scatter!(figure, [1-μ], [0], label="Moon", xlabel="X (Earth-Moon Distance)", ylabel="Y (Earth-Moon Distance)", marker=:x, color=:black, markersize=10,)

Makie.jl

Image

fig = Figure(size=(800, 400), fontsize=20)
ax = Axis(fig[1, 1];
    xreversed = true,
    aspect = DataAspect(),
    xlabel = "X (Earth-Moon Distance)",
    ylabel = "Y (Earth-Moon Distance)",
    # labelsize = 12,
    title = "Unstable and Stable Invariant Manifolds",
    titlesize = 24,
)

cmap = resample_cmap(:blues, length(unstable))
for (i, m) in enumerate(unstable)
    plot!(ax, m; idxs=(:x, :y), color=cmap[i])
end

cmap = resample_cmap(:blues, length(stable))
for (i, m) in enumerate(stable)
    plot!(ax, m; idxs=(:x, :y), color=cmap[i])
end

scatter!(ax, [1-μ], [0]; marker=:x, color=:black, markersize=50, label="Moon")

fig

I have exactly zero experience with the SciML ecosystem, so my b if you had something else in mind 😅

@cadojo
Copy link
Collaborator Author

cadojo commented Feb 27, 2025

This looks great! Thanks for sharing and figuring this out. I do hope to continue to use SciML under the hood here, so I think using their built-in Makie integration is great. If you'd like to submit your examples as a PR to the documentation for AstrodynamicalSolvers, please feel free to!

Otherwise, I'll try to take another swing at updating documentation this weekend. This package is in the tail end of a major refactor, and I'm hoping to clean everything up and re-document the packages this year.

@icweaver
Copy link
Member

Thanks! For sure, just opened #236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants