# How do I wait for a Plots.jl window to be closed?

**URL:** <https://discourse.julialang.org/t/how-do-i-wait-for-a-plots-jl-window-to-be-closed/80122>\
**Category:** General Usage\
**Tags:** plots, gr, gui\
**Created:** [April 27, 2022, 10:48am UTC](https://discourse.julialang.org/t/how-do-i-wait-for-a-plots-jl-window-to-be-closed/80122 "2022-04-27T10:48:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![baandersen](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@baandersen](https://discourse.julialang.org/u/baandersen)\
**Post date:** [April 27, 2022, 3:01pm UTC](https://discourse.julialang.org/t/how-do-i-wait-for-a-plots-jl-window-to-be-closed/80122/2 "2022-04-27T15:01:33Z")

</div>

I do it like this (in GR)

```julia
using Plots
f(x) = x^2
x = collect(-10:10)
y = f.(x)
println(y)
p = plot(x, y, label=false, lw=1.0)
title!("f(x) = x^2")
display(p)
println("\npress enter to close plot")
readline()

```

---

_[View the full topic](https://discourse.julialang.org/t/how-do-i-wait-for-a-plots-jl-window-to-be-closed/80122)._
