I am attempting to get the x, y position of a mouse click with respect to a plotted image. The code shown below is working except for a white border around the image. The returned x, y values include this border and the border changes as I resize the window. I have attempted to use padding = (0.0, 0.0) with no effect.
Any tips on how I could eliminate the border or get the x, y coordinates with respect to just the plot area?
using Makie
using Colors
scene = Scene(show_axis=false, resolution = (500, 500), padding = (0.0, 0.0))
image!(scene, rand(RGB{Float64}, (500,500)), interpolate=false, padding = (0.0, 0.0))
display(scene)
on(scene.events.mousebuttons) do button
if ispressed(button, Mouse.left)
println("Click ", scene.events.mouseposition[], scene.px_area[].widths)
end
end