# Update image data in existing imshow

**URL:** <https://discourse.julialang.org/t/update-image-data-in-existing-imshow/9609>\
**Category:** Visualization\
**Tags:** question, images, gtk\
**Created:** [March 9, 2018, 12:37pm UTC](https://discourse.julialang.org/t/update-image-data-in-existing-imshow/9609 "2018-03-09T12:37:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [March 9, 2018, 1:24pm UTC](https://discourse.julialang.org/t/update-image-data-in-existing-imshow/9609/2 "2018-03-09T13:24:40Z")

</div>

Solved it myself!

So the image data that imshow displays is the exact data I should be changing:

```julia
data = rand(RGB, n, n)
g = imshow(data)
data[1] = RGB(1,1,1) # update the image data

```

Now nothing has yet been updated in the window, so I need to fake an update event. I do this by:

```julia
zr = g["roi"]["zoomregion"]
push!(zr, value(zr).currentview)

```

and it works!

---

_[View the full topic](https://discourse.julialang.org/t/update-image-data-in-existing-imshow/9609)._
