# Manual section on plotting from script incomplete?

**URL:** <https://discourse.julialang.org/t/manual-section-on-plotting-from-script-incomplete/62807>\
**Category:** New to Julia\
**Created:** [June 12, 2021, 7:14pm UTC](https://discourse.julialang.org/t/manual-section-on-plotting-from-script-incomplete/62807 "2021-06-12T19:14:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulmelis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulmelis/32/35063_2.png) [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Post date:** [June 12, 2021, 7:14pm UTC](https://discourse.julialang.org/t/manual-section-on-plotting-from-script-incomplete/62807/1 "2021-06-12T19:14:04Z")

</div>

[Tutorial · Plots](https://docs.juliaplots.org/latest/tutorial/#Plotting-in-Scripts) says

> In a script, Julia does not do automatic displays (which is why `;` is not necessary). However, if we would like to display our plots in a script, this means we just need to add the `display` call. For example:
> 
> ```julia
> display(plot(x, y))
> 
> ```

However, as [others](https://discourse.julialang.org/t/how-to-make-plot-window-stay-open-when-running-a-jl-script/23484) have noted this isn’t enough for a plot window to actually get shown. For example, with

```julia
$ cat t.jl 
using Plots, Random

x = 1:10
y = rand(10,2)

display(plot(x,y))

```

on my Arch Linux system with 1.6.1 `julia t.jl` will not show a plot window. I need to add the `-i` option to fix it. This actually makes sense, as that will keep the `julia` process alive. So I’m wondering if the above doc section should not also mention that?

---

<div class="post-metadata">

**Author:** ![Erasmo98](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erasmo98/32/26098_2.png) [@Erasmo98](https://discourse.julialang.org/u/Erasmo98)\
**Post date:** [June 16, 2021, 4:20am UTC](https://discourse.julialang.org/t/manual-section-on-plotting-from-script-incomplete/62807/2 "2021-06-16T04:20:27Z")

</div>

Take a look to [Output · Plots](http://docs.juliaplots.org/latest/output/#output)

> **A Plot is only displayed when returned** (a semicolon will suppress the return), or if explicitly displayed with `display(plt)` , `gui()` , or by adding `show = true` to your plot command.

If you have any suggestion to the documentation, you can create a pull request (PR) in GitHub as follows.

 ![Captura de pantalla (257)_LI](https://global.discourse-cdn.com/julialang/original/3X/2/c/2caafab78398f1479fc65dcca8e6512f2ca4fcaa.jpeg)  
 ![Captura de pantalla (261)_LI](https://global.discourse-cdn.com/julialang/original/3X/5/9/59138b0510bb233d3f36a84fabf91c3335f52096.jpeg)

---

<div class="post-metadata">

**Author:** ![paulmelis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulmelis/32/35063_2.png) [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Post date:** [June 16, 2021, 6:34am UTC](https://discourse.julialang.org/t/manual-section-on-plotting-from-script-incomplete/62807/3 "2021-06-16T06:34:12Z")

</div>

Yes, I know that, but I’m still wondering if the docs are at fault here, or if there is something else going on. Should `display(plot(...))` always show a window if called from a script without the `-i` option?

---

<div class="post-metadata">

**Author:** ![Erasmo98](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erasmo98/32/26098_2.png) [@Erasmo98](https://discourse.julialang.org/u/Erasmo98)\
**Post date:** [June 19, 2021, 11:21pm UTC](https://discourse.julialang.org/t/manual-section-on-plotting-from-script-incomplete/62807/4 "2021-06-19T23:21:16Z")

</div>

Sorry, I misunderstood your question; I thought you were asking about the docs, in which case I invite you to make your suggestions as a PR.

I don’t know if the `-i` option is necessary to display the window…
