# Get plot coordinates of a GLMakie mouse event

**URL:** <https://discourse.julialang.org/t/get-plot-coordinates-of-a-glmakie-mouse-event/124437>\
**Category:** General Usage\
**Created:** [January 4, 2025, 11:26pm UTC](https://discourse.julialang.org/t/get-plot-coordinates-of-a-glmakie-mouse-event/124437 "2025-01-04T23:26:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janonime](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/janonime/32/202344_2.png) [@janonime](https://discourse.julialang.org/u/janonime)\
**Post date:** [January 4, 2025, 11:26pm UTC](https://discourse.julialang.org/t/get-plot-coordinates-of-a-glmakie-mouse-event/124437/1 "2025-01-04T23:26:50Z")

</div>

It is easy to get the position of a mouse event in [pixel coordinates](https://docs.makie.org/stable/explanations/events#Mouse-Interaction):

```julia
using GLMakie

fig = Figure()
ax = Axis(fig[1,1])

on(events(ax).mousebutton) do event
    if event.button == Mouse.left
        if event.action == Mouse.press || event.action == Mouse.release
            mp = events(ax).mouseposition[]
            println(mp)
        end
    end
end

fig

```

How does one obtain the corresponding plot coordinates?
