# Plots.jl GKS failing

**URL:** <https://discourse.julialang.org/t/plots-jl-gks-failing/90424>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [November 18, 2022, 1:56am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424 "2022-11-18T01:56:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 18, 2022, 1:56am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/1 "2022-11-18T01:56:57Z")

</div>

Hi

Having issues with the Plots.jl package after a Windows update. I receive error messages of the following form whenever I try to run any GUI command (e.g. scatter(1:10,1:10)):

```julia
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER 

```

This behaviour happens on my Windows machine, and identical behaviour occurs on an Ubuntu VM. This has only begun to occur after a Windows update, no changes have been made to the julia installation, environment, or anything. The Ubuntu VM has all the plugins (Qt5 etc.) recommended in other threads about this problem. Any help? I have an intuition that something is being blocked by a Windows firewall but I have no clue what that would be or how to fix it.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [November 18, 2022, 4:16am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/2 "2022-11-18T04:16:35Z")

</div>

Just to confirm, you’ve run a package update for your Julia enviroment?

```julia
 pkg> up Plots

```

This might have been addressed here: [GKS problem on Win11 · Issue #475 · jheinen/GR.jl · GitHub](https://github.com/jheinen/GR.jl/issues/475)  
Otherwise, what does this give?

```julia
pkg> st -m GR_jll GR

```

---

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 20, 2022, 8:01pm UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/3 "2022-11-20T20:01:55Z")

</div>

I have updated Plots. The second command produces the following output:

```julia
(@v1.4) pkg> st -m GR_jll GR
Status `~/.julia/environments/v1.4/Manifest.toml`
  [56f22d72] Artifacts v1.3.0
  [6e34b625] Bzip2_jll v1.0.6+5
  [83423d85] Cairo_jll v1.16.0+6
  [b22a6f82] FFMPEG_jll v4.3.1+4
  [a3f928ae] Fontconfig_jll v2.13.1+14
  [0656b61e] GLFW_jll v3.3.4+0
  [28b8d3ca] GR v0.52.0
  [d2c73de3] GR_jll v0.58.1+0
  [cd3eb016] HTTP v0.8.19
  [692b3bcd] JLLWrappers v1.4.1
  [682c06a0] JSON v0.21.3
  [aacddb02] JpegTurbo_jll v2.0.1+3
  [89763e89] Libtiff_jll v4.1.0+2
  [30392449] Pixman_jll v0.40.0+0
  [ea2cea3b] Qt5Base_jll v5.15.2+0
  [83775a58] Zlib_jll v1.2.11+18
  [b53b4c65] libpng_jll v1.6.37+6
  [2a0f44e3] Base64 
  [8bb1440f] DelimitedFiles 
  [8f399da3] Libdl 
  [37e2e46d] LinearAlgebra 
  [44cfe95a] Pkg 
  [de0858da] Printf 
  [9a3f8284] Random 
  [9e88b42a] Serialization 
  [6462fe0b] Sockets 
  [8dfed614] Test 
  [cf7118a7] UUIDs

```

I also tried doing a

```julia
pkg> test GR

```

and all tests passed, but I still get the same exact error message dump when I try to use any plotting commands from the REPL

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 20, 2022, 8:48pm UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/4 "2022-11-20T20:48:41Z")

</div>

Why are you on Julia 1.4?

---

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 20, 2022, 8:57pm UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/5 "2022-11-20T20:57:27Z")

</div>

That’s just the version I got when I apt installed julia on the VM. The windows install is v1.7.1 and still produces the same exact error messages though

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 20, 2022, 9:31pm UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/6 "2022-11-20T21:31:40Z")

</div>

So the output you’re showing does not show the GR and GR jll versions which generate your error? Because both of these packages are pretty outdated on the output you’re showing.

---

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 20, 2022, 9:47pm UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/7 "2022-11-20T21:47:42Z")

</div>

Output on the Windows install:

```julia
(@v1.7) pkg> st -m GR_jll GR
      Status `C:\Users\Username\.julia\environments\v1.7\Manifest.toml`
  [28b8d3ca] GR v0.66.2
  [d2c73de3] GR_jll v0.69.1+0

```

![image](https://global.discourse-cdn.com/julialang/original/3X/6/8/68450beece8e555eea32ea75146e93904c05eb6b.png)

I also get this error message the first time I try to run a plot command:

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [November 20, 2022, 11:39pm UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/8 "2022-11-20T23:39:14Z")

</div>

This is the exact error from the issue I linked before; see [here](https://github.com/jheinen/GR.jl/issues/475#issuecomment-1269512479).

This was addressed, so updating GR to [v0.69.5](https://github.com/jheinen/GR.jl/releases/tag/v0.69.5) or above should help.

---

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 21, 2022, 12:13am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/9 "2022-11-21T00:13:20Z")

</div>

Just updated GR to v0.69.5 and still getting the exact same error:

```julia
(@v1.7) pkg> st -m GR_jll GR
      Status `C:\Users\Username\.julia\environments\v1.7\Manifest.toml`
  [28b8d3ca] GR v0.69.5
  [d2c73de3] GR_jll v0.69.1+0

julia> scatter(1:10,1:10)
connect: No error
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER

```

---

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 21, 2022, 12:39am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/10 "2022-11-21T00:39:43Z")

</div>

Sorry - my bad. Updated GR\_jll to v0.70.0 and it worked.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [November 21, 2022, 12:59am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/11 "2022-11-21T00:59:02Z")

</div>

Hmm. This seems to be an area that the GR.jl maintainers are actively working to address.  
Can you start a fresh julia session, activate a temporary environment and add Plots?

```julia
] activate --temp
] add Plots

```

then try `scatter(1:10,1:10)`.

---

<div class="post-metadata">

**Author:** ![alexsss](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Post date:** [November 21, 2022, 1:23am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/12 "2022-11-21T01:23:10Z")

</div>

Just tried this, in the temp environment it just hangs after I run the scatter command. No dialogue box or error output to the terminal, no plot window.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [November 21, 2022, 1:26am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424/13 "2022-11-21T01:26:07Z")

</div>

Ok. I think the solution is the one you marked, which is updating GR\_jll to a version 0.70 or higher.
