AbstractPlotting documentation?

Is there a documentation for AbstractPlotting? I would like to know how to couple the height of two scenes(heatmap, colorbar) and how to detect that the window of an interactive scene is closed.

Makie & AbstractPlotting have the same documentation (Makie is just AbstractPlotting + a standard rendering Backend).

that the window of an interactive scene is closed.

isopen(scene)

I would like to know how to couple the height of two scenes(heatmap, colorbar)

That may be a bit more complicated… You can take a look at: https://github.com/JuliaPlots/AbstractPlotting.jl/blob/master/src/layouting/layouting.jl#L182

I managed to use isopen. Is there a better way to do this?

using Makie, FFTW, LinearAlgebra

function wait(scene::Scene)
    while isopen(scene)
        sleep(1)
    end
end

function gui_select_g(img::AbstractArray{T,2}) where T <: Number
    scene = Scene()
    gvectors = []

    on(scene.events.mousebuttons) do buttons
        if ispressed(scene, Mouse.left)
            pos = to_world(scene, Point2f0(scene.events.mouseposition[]))
            push!(gvectors,pos)
        end
        return
    end

    rfft = fft(img)
    powerspectrum = log.(norm.(fftshift(rfft)).+floatmin(Float32))
    heatmap!(scene, powerspectrum, transpose=true, yflip=true)
    display(AbstractPlotting.PlotDisplay(), scene)
    wait(scene)
    gvectors
end

@show gui_select_g(rand(100,100))

1 Like