# Makie - mouseposition with respect to image plot

**URL:** <https://discourse.julialang.org/t/makie-mouseposition-with-respect-to-image-plot/51268>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [December 4, 2020, 6:37pm UTC](https://discourse.julialang.org/t/makie-mouseposition-with-respect-to-image-plot/51268 "2020-12-04T18:37:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnief3](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@arnief3](https://discourse.julialang.org/u/arnief3)\
**Post date:** [December 4, 2020, 6:37pm UTC](https://discourse.julialang.org/t/makie-mouseposition-with-respect-to-image-plot/51268/1 "2020-12-04T18:37:05Z")

</div>

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?

```julia

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

```

 ![Screenshot from 2020-12-04 10-38-08](https://global.discourse-cdn.com/julialang/original/3X/b/1/b1fc67ddbe2946dee3d37d933374a5229b9e3e95.jpeg)

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [December 8, 2020, 10:17am UTC](https://discourse.julialang.org/t/makie-mouseposition-with-respect-to-image-plot/51268/2 "2020-12-08T10:17:13Z")

</div>

Try the `campixel!` camera:

```julia
using Makie
using Colors

scene = Scene(camera=campixel!, raw=true, resolution = (500, 500))
image!(scene, rand(RGB{Float64}, (500,500)))

```

---

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [February 7, 2022, 4:40pm UTC](https://discourse.julialang.org/t/makie-mouseposition-with-respect-to-image-plot/51268/3 "2022-02-07T16:40:08Z")

</div>

Does anyone have an update on how to do this in 2022?
