# Continuously plot to the same window on the fly

**URL:** <https://discourse.julialang.org/t/continuously-plot-to-the-same-window-on-the-fly/95498>\
**Category:** Visualization\
**Tags:** gaston\
**Created:** [March 3, 2023, 2:32pm UTC](https://discourse.julialang.org/t/continuously-plot-to-the-same-window-on-the-fly/95498 "2023-03-03T14:32:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linwaytin](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Post date:** [March 3, 2023, 2:32pm UTC](https://discourse.julialang.org/t/continuously-plot-to-the-same-window-on-the-fly/95498/1 "2023-03-03T14:32:57Z")

</div>

I have for loop which runs some computation. For debugging, I want to see the output “real-time”. One possible way to do that is continuously plotting add points to the same graph.

```julia
using Gaston
plot(something)
for iter=1:100
    res = myProg(...)
    plot!(res) |> display
end

```

As shown above, I tried to use Gaston to do this. This seems to work, but the use of `plot!(res) |> display` seems strange, as I do not see it in the manual of Gaston.

Could anyone comment on this? Or if you have a better way to plot the results on the fly, please let me know. Thank you!

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [March 3, 2023, 5:46pm UTC](https://discourse.julialang.org/t/continuously-plot-to-the-same-window-on-the-fly/95498/2 "2023-03-03T17:46:15Z")

</div>

This is discussed in [Gaston.jl’s package FAQ](https://mbaz.github.io/Gaston.jl/stable/faq/#I-run-plot-inside-a-for-loop-and-no-plots-are-produced!-(or:-Julia's-display-system)-1).

---

<div class="post-metadata">

**Author:** ![linwaytin](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Post date:** [March 3, 2023, 9:08pm UTC](https://discourse.julialang.org/t/continuously-plot-to-the-same-window-on-the-fly/95498/3 "2023-03-03T21:08:08Z")

</div>

Thank you! Didn’t know this page, which is exactly what I need.
