bifurcationkit/BifurcationKit.jl

Plotting with Makie

ymaltsman opened this issue · 3 comments

It seems fairly complicated to plot bifurcation diagrams with packages other than Plots.jl, as explained in the bottom of the plotting documentation. I would like to position bifurcation diagrams next to some plots I generated with GLMakie, and it would be nice to have something like GLMakie.lines!(ax, br) similarly to how we can do Plots.plot(br).
I'd be happy to try to implement this but would need a bit of guidance.

rveltz commented

I am away from my computer but will try to help as i can.

This is related to #54

But more importandly to #84

In particular, there is a beginning of Makie solution there: if it can help

https://github.com/bifurcationkit/BifurcationKit.jl/blob/master/src/plotting/RecipesMakie.jl

rveltz commented

If you know how to do plot recipes in Makie I would be happy to help you. Perhaps the easiest way is to do this in a dedicated package. Thank you for your help

rveltz commented

It is solved on master. Example:

using Revise, GLMakie, BifurcationKit
Makie.inline!(true)
q = 1/0
k = 2
F(x, p) = (@. p + x - x^(k+1)/(k+1))
prob = BifurcationProblem(F, [0.8], 1., (@lens _); recordFromSolution = (x,p) -> x[1])
opts = ContinuationPar(dsmax = 0.1, dsmin = 1e-3, ds = -0.001, pMin = -1., pMax = 1.)
br = continuation(prob, PALC(), opts ; plot = true) # this shows diagram during comnputation
BifurcationKit.plot(br)
BifurcationKit.plot(br, br) # draw 2 branches

It could be much improved but I hope it serves you right. Please submit a PR if you know how to improve this.