diff --git a/Project.toml b/Project.toml index 3ec3393..4fef607 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Fatou" uuid = "5f923234-c850-556d-bb4f-28324fa1959a" authors = ["Michael Reed"] -version = "1.1.4" +version = "1.1.5" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/src/Fatou.jl b/src/Fatou.jl index 93edc41..9cac39b 100644 --- a/src/Fatou.jl +++ b/src/Fatou.jl @@ -377,7 +377,7 @@ function __init__() !bare && print(io,String(K)) end end - @require AbstractPlotting="537997a7-5e4e-5d89-9595-2241ea00577e" include("makie.jl") + @require Makie="ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" include("makie.jl") @require PyPlot="d330b81b-6aea-500a-939a-2ce795aea3ee" include("pyplot.jl") @require UnicodePlots="b8865327-cd53-5732-bb35-84acbb429228" include("uniplots.jl") end diff --git a/src/makie.jl b/src/makie.jl index 935b8bb..2bdd4c1 100644 --- a/src/makie.jl +++ b/src/makie.jl @@ -3,75 +3,75 @@ import ColorSchemes -AbstractPlotting.plot(K::FilledSet;bare=false,args...) = AbstractPlotting.heatmap(K;bare=bare,args...) +Makie.plot(K::FilledSet;bare=false,args...) = Makie.heatmap(K;bare=bare,args...) for plt ∈ (:contour,:contourf,:heatmap) plt! = Symbol(plt,:!) - @eval function AbstractPlotting.$plt(K::FilledSet;bare::Bool=false,args...) - scene, layout = AbstractPlotting.layoutscene() + @eval function Makie.$plt(K::FilledSet;bare::Bool=false,args...) + scene, layout = Makie.layoutscene() ax = layout[1,1] = if K.meta.newt - AbstractPlotting.Axis(scene,title=String(K),ylabel="Fatou set: z ↦ z-m×f(z)/f'(z)") + Makie.Axis(scene,title=String(K),ylabel="Fatou set: z ↦ z-m×f(z)/f'(z)") else - AbstractPlotting.Axis(scene,title=String(K)) + Makie.Axis(scene,title=String(K)) end - plt = AbstractPlotting.$plt!(ax,K;args...) - layout[1,2] = AbstractPlotting.Colorbar(scene,plt;width=30) + plt = Makie.$plt!(ax,K;args...) + layout[1,2] = Makie.Colorbar(scene,plt;width=30) return scene end - @eval function AbstractPlotting.$plt!(ax,K::FilledSet;bare::Bool=false,args...) - !haskey(args,:colormap) && !isempty(K.meta.cmap) && (return AbstractPlotting.$plt!(ax,K;bare=bare,colormap=Symbol(K.meta.cmap),args...)) + @eval function Makie.$plt!(ax,K::FilledSet;bare::Bool=false,args...) + !haskey(args,:colormap) && !isempty(K.meta.cmap) && (return Makie.$plt!(ax,K;bare=bare,colormap=Symbol(K.meta.cmap),args...)) r1,r2 = ranges(K) Z = $(plt≠:heatmap ? :(transpose(K.meta.iter ? K.iter : K.mix)) : :(reverse(transpose(K.meta.iter ? K.iter : K.mix),dims=2))) if bare - AbstractPlotting.$plt!(ax,r1,r2,Z;args...) + Makie.$plt!(ax,r1,r2,Z;args...) else - AbstractPlotting.$plt!(ax,r1,r2,Z;axis=(title=String(K),),args...) + Makie.$plt!(ax,r1,r2,Z;axis=(title=String(K),),args...) end end end # center!(scene) -function AbstractPlotting.surface(K::FilledSet;bare::Bool=false,args...) - !haskey(args,:colormap) && !isempty(K.meta.cmap) && (return AbstractPlotting.surface(K;bare=bare,colormap=Symbol(K.meta.cmap),args...)) +function Makie.surface(K::FilledSet;bare::Bool=false,args...) + !haskey(args,:colormap) && !isempty(K.meta.cmap) && (return Makie.surface(K;bare=bare,colormap=Symbol(K.meta.cmap),args...)) r1,r2 = ranges(K) Z = reverse(reverse(transpose(K.meta.iter ? K.iter : K.mix),dims=1),dims=2) if bare - AbstractPlotting.surface(reverse(r1),r2,Z;(xreversed=true,)args...) + Makie.surface(reverse(r1),r2,Z;(xreversed=true,)args...) else - AbstractPlotting.surface(reverse(r1),r2,Z;axis=(title=String(K),xreversed=true),args...) + Makie.surface(reverse(r1),r2,Z;axis=(title=String(K),xreversed=true),args...) end end -function AbstractPlotting.arrows(K::FilledSet;bare::Bool=false,args...) +function Makie.arrows(K::FilledSet;bare::Bool=false,args...) r1,r2 = ranges(K) Z = transpose(K.set.Ω) - AbstractPlotting.arrows(r1,r2,real.(Z),imag.(Z);args...) + Makie.arrows(r1,r2,real.(Z),imag.(Z);args...) end function orbit(E,f::Function,bi::Matrix{Float64},orb::Int=0,depth::Int=1,incr::Int=384) x,N,N2,orbit,bis = real_orb(E,f,bi,orb,depth,incr) # setup plot funs,funt = ~(orb == 0) ? (["ϕ(x₀₋ₙ)"],", IC: x₀ = $(bis[3]), n∈0:$orb") : ([],"") - scene, layout = AbstractPlotting.layoutscene() - ax = layout[1,1] = AbstractPlotting.Axis(scene,title="x ↦ $E$funt") + scene, layout = Makie.layoutscene() + ax = layout[1,1] = Makie.Axis(scene,title="x ↦ $E$funt") # plot background lines - plt = [AbstractPlotting.lines!(ax,x[:],N[:,1];linestyle=:dash), - AbstractPlotting.lines!(ax,x[:],N[:,2]), + plt = [Makie.lines!(ax,x[:],N[:,1];linestyle=:dash), + Makie.lines!(ax,x[:],N[:,2]), # plot orbit cobweb path - AbstractPlotting.lines!(ax,orbit[:,1],orbit[:,2];color=:red)] + Makie.lines!(ax,orbit[:,1],orbit[:,2];color=:red)] # plot f^2,f^3,f^4,... for h ∈ 3:depth+1 - push!(plt,AbstractPlotting.lines!(ax,x,N[:,h];linewidth=1,color=ColorSchemes.tab10[h>5 ? h-1 : h-2])) + push!(plt,Makie.lines!(ax,x,N[:,h];linewidth=1,color=ColorSchemes.tab10[h>5 ? h-1 : h-2])) end if orb≠0 ran = range(bi[1],stop=bi[2],length=length(N2)) plt = [plt...,[ - AbstractPlotting.lines!(ax,ran,N2[:];color=:gray,linestyle=:dot,linewidth=1), - AbstractPlotting.scatter!(ax,ran,N2[:];color=:gray,marker=:x)]] + Makie.lines!(ax,ran,N2[:];color=:gray,linestyle=:dot,linewidth=1), + Makie.scatter!(ax,ran,N2[:];color=:gray,marker=:x)]] end # trim graph d=1.07 - AbstractPlotting.xlims!(ax,bi[1],bi[2]) - AbstractPlotting.ylims!(ax,minimum([d*minimum(N[:,2]),0]),maximum([d*maximum(N[:,2]),0])) + Makie.xlims!(ax,bi[1],bi[2]) + Makie.ylims!(ax,minimum([d*minimum(N[:,2]),0]),maximum([d*maximum(N[:,2]),0])) # set legend layout[1,2] = Legend(scene,plt,vcat(["y=x","ϕ(x)","(xₙ,ϕ(xₙ))"],["ϕ^$x(x)" for x ∈ 2:depth],funs)) return scene