# Plots.jl plot window launched from a signal within Gtk.jl does not open—how to fix?

**URL:** https://discourse.julialang.org/t/plots-jl-plot-window-launched-from-a-signal-within-gtk-jl-does-not-open-how-to-fix/58384
**Category:** Visualization
**Created:** [April 1, 2021, 6:09pm UTC](https://discourse.julialang.org/t/plots-jl-plot-window-launched-from-a-signal-within-gtk-jl-does-not-open-how-to-fix/58384 "2021-04-01T18:09:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cdknight](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cdknight/32/23533_2.png) [@cdknight](https://discourse.julialang.org/u/cdknight)
#### Post date: [April 1, 2021, 6:09pm UTC](https://discourse.julialang.org/t/plots-jl-plot-window-launched-from-a-signal-within-gtk-jl-does-not-open-how-to-fix/58384/1 "2021-04-01T18:09:29Z")

</div>

Hi, I’m new here (and to the Julia programming language in general), and hopefully this is the right category. Anyway, I’m attempting to make a GUI to facilitate some visualisation that I’m doing. What I want is to click a button in my Gtk GUI and have a separate visualisation window open. In the example I’m providing, the `plotly` backend does not work, but I have tested this example with other backends (such as `pyplot`, which I also use sometimes as each backend has its own strengths and weaknesses).

Just to make sure this isn’t an OS issue, I have tested this on both Linux and OS X and both of them have the same issue. I’m thinking this issue is caused because `plot` cannot be run in a thread.

Example:

```julia
using Gtk, Plots
plotly()

b = GtkButton("open plot")
signal_connect(b, "clicked") do w
  plot(1:5)
end

wi = GtkWindow(b, "Plots.jl failure demonstration")
showall(wi)

```

I’m thinking that I can use multiprocessing or a subprocess somehow to display my visualisations, but I find that solution to be quite a bit unwieldy and I’d like to avoid it if I can. Is there a better way to do what I want?

Also, I explicitly do not want to embed these graphs in Gtk for now, so that would not be a solution.

---

<div class="post-metadata">

### Author: ![cdknight](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cdknight/32/23533_2.png) [@cdknight](https://discourse.julialang.org/u/cdknight)
#### Post date: [April 1, 2021, 8:18pm UTC](https://discourse.julialang.org/t/plots-jl-plot-window-launched-from-a-signal-within-gtk-jl-does-not-open-how-to-fix/58384/2 "2021-04-01T20:18:29Z")

</div>

Well, I figured it out myself. You have to call `gui()` after you run `plot`. Not sure why that works, though.
