# Gnuplot from VSCode: no plot

**URL:** <https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458>\
**Category:** General Usage\
**Created:** [July 28, 2021, 8:22pm UTC](https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458 "2021-07-28T20:22:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [July 28, 2021, 8:22pm UTC](https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458/1 "2021-07-28T20:22:06Z")

</div>

When I run gnuplot from within vscode, I get nothing: no error, but no plot either. Running gnuplot from the shell works fine.

This works:

```julia
shell> gnuplot

        G N U P L O T
        Version 5.2 patchlevel 8 last modified 2019-12-01

        Copyright (C) 1986-1993, 1998, 2004, 2007-2019
        Thomas Williams, Colin Kelley and many others

        gnuplot home: http://www.gnuplot.info
        faq, bugs, etc: type "help FAQ"
        immediate help: type "help" (plot window: hit 'h')

Terminal type is now 'windows'
Options are '0 color solid butt enhanced standalone size 887,435'
Encoding set to 'cp1252'.
gnuplot> plot sin(x)
gnuplot> quit

```

This doesn’t:

```julia
julia> using Gnuplot

julia> @gp "plot sin(x)"

```

Does anyone have any clue what’s going on?

Julia 1.6.2, Windows 10.

---

<div class="post-metadata">

**Author:** ![gcalderone](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gcalderone/32/1539_2.png) [@gcalderone](https://discourse.julialang.org/u/gcalderone)\
**Post date:** [July 29, 2021, 7:15am UTC](https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458/2 "2021-07-29T07:15:02Z")

</div>

Try setting of `Gnuplot.options.gpviewer = true` to use the gnuplot terminal window (further info in the [docs](https://github.com/gcalderone/Gnuplot.jl/blob/gh-pages/v1.3.0/options/display.ipynb) and in the [repo issue](https://github.com/gcalderone/Gnuplot.jl/issues/45)).

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 14, 2022, 8:37pm UTC](https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458/3 "2022-03-14T20:37:51Z")

</div>

This solution stopped working. No plots again, and this time I am sure to have this setting in.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 14, 2022, 8:39pm UTC](https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458/4 "2022-03-14T20:39:27Z")

</div>

> [@gcalderone](#):
>
> Gnuplot.options.gpviewer = true

Update. I got the plot to show, but I had to use this incantation in the command line. It was not enough to have it in the module doing the plotting.

---

<div class="post-metadata">

**Author:** ![gcalderone](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gcalderone/32/1539_2.png) [@gcalderone](https://discourse.julialang.org/u/gcalderone)\
**Post date:** [March 15, 2022, 9:00am UTC](https://discourse.julialang.org/t/gnuplot-from-vscode-no-plot/65458/5 "2022-03-15T09:00:57Z")

</div>

The `gpviewer` is first set during module initialization, i.e. in the `Gnuplot. __init__ ` function.  
Hence the approach should be as follows:

```julia
using Gnuplot
Gnuplot.options.gpviewer = true

```

There is no other possibility for this setting to be changed within the `Gnuplot.jl` package, so once set it is supposed to retain its value for the whole session (unless explicitly changed).
