# GtkReactive GUI with a plots.jl image

**URL:** <https://discourse.julialang.org/t/gtkreactive-gui-with-a-plots-jl-image/61471>\
**Category:** Visualization\
**Tags:** gui\
**Created:** [May 19, 2021, 10:00pm UTC](https://discourse.julialang.org/t/gtkreactive-gui-with-a-plots-jl-image/61471 "2021-05-19T22:00:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelsonah](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nelsonah](https://discourse.julialang.org/u/nelsonah)\
**Post date:** [May 19, 2021, 10:00pm UTC](https://discourse.julialang.org/t/gtkreactive-gui-with-a-plots-jl-image/61471/1 "2021-05-19T22:00:27Z")

</div>

I have an array of pixels called **points** starting as follows:  
points: HSV{Float64}[HSV{Float64}(94.21025111030258,0.8823529411764706,1.0) HSV{Float64}(95.58982630472542,0.8823529411764706,1.0) ……

I want it to look like the following image, obtained by “img2 = testimage(“lighthouse”)”  
RGB{FixedPointNumbers.Normed{UInt8,8}}[RGB{N0f8}(0.361,0.486,0.6) RGB{N0f8}(0.349,0.475,0.588) …..

I tried: img3 = RGB.(points) which converted the array to RGB but not UInt8,8  
img3: RGB{Float64}[RGB{Float64}(0.496908071907315,1.0,0.11764705882352944) RGB{Float64}(0.47662020140109673,1.0,0.11764705882352944) ….

# What should my img3 = RGB command look like?

My situation:  
The points array is a Mandelbrot subplot that nicely displays using the following commands:  
plt = plot(points); # using Plots and gr()  
img = display(plt)

However, my goal is to enhance the image (title, axis, etc.) using plots and then use the following GtkReactive code (from example imageviewer.jl) to display and interact with it:

c = canvas(UserUnit)  
win = Window(c)  
zr = Signal(ZoomRegion(img3)) # this is where img3 fails, but img2 works great  
zoomsigs = init\_zoom\_rubberband(c, zr)  
imgsig = map(zr) do r  
cv = r.currentview  
view(plt, UnitRange{Int}(cv.y), UnitRange{Int}(cv.x))  
end  
redraw = draw(c, imgsig) do cnvs, image  
copy!(cnvs, image)  
set\_coordinates(cnvs, value(zr))  
end  
Gtk.showall(win)

Long range: modify the above code to recompute points using the rubberband info, and eventually add some gui widgets for further interactions.
