Gnuplot.jl + Windows 10: mouse can't zoom in/out

Dear all,
I have Windows 10 64-bit, gnuplot Version 5.4 patchlevel 1 (terminal qt) and Julia 1.6.1 with Gnuplot.jl v1.4.0 .

When i use gnuplot without julia: gnuplot> plot sin(x)
i get the plot fine. Mouse can zoom in/out, coordinates change and i can set grid with button.

However, when i use gnuplot via Julia: using Gnuplot ; @gp 1:20
i get the plot, but mouse can’t zoom in/out, coordinates not change and grid button don’t work.

When i run the second time @gp 1:20
i get the error:

GNUPLOT (default) -> gnuplot> p 
GNUPLOT (default) ->          line 42: no datablock named $data1print
GNUPLOT (default) -> gnuplot> rint 'GNUPLOT_CAPTURE_BEGIN'
GNUPLOT (default) ->          ^
GNUPLOT (default) ->          line 42: invalid command
┌ Error:
└ @ Gnuplot C:\Users\ms\.julia\packages\Gnuplot\jJ4hs\src\Gnuplot.jl:908
ERROR: Gnuplot error: ["invalid command"]
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] gpexec(gp::Gnuplot.GPSession, command::String)
   @ Gnuplot C:\Users\ms\.julia\packages\Gnuplot\jJ4hs\src\Gnuplot.jl:911
 [3] reset(gp::Gnuplot.GPSession)
   @ Gnuplot C:\Users\ms\.julia\packages\Gnuplot\jJ4hs\src\Gnuplot.jl:765
 [4] driver(_args::UnitRange{Int64}; is3d::Bool)
   @ Gnuplot C:\Users\ms\.julia\packages\Gnuplot\jJ4hs\src\Gnuplot.jl:1283
 [5] driver(_args::UnitRange{Int64})
   @ Gnuplot C:\Users\ms\.julia\packages\Gnuplot\jJ4hs\src\Gnuplot.jl:1262
 [6] top-level scope
   @ REPL[6]:1 

when i run the third time @gp 1:20 , i get the plot (as the first time) without any interaction again…

Please, can you help me with this ? Why the plot isn’t interactive ?
Thanks a lot !

I use the “windows” terminal, or the “wxt” terminal. IIRC it is because I’ve had problems such that you describe. I am not sure why that should be, perhaps incorrect versions of dynamic libs?

1 Like

Hi,
I installed gnuplot 5.2.8 and suddenly now it is interactive and mouse works!
However the same error still exist when i plot second time, but with the third time it’s plot again fine.

Hi, I am the maintainer of the Gnuplot.jl package. I never saw this problem, but I’m not really surprised since the gnuplot program do not provide any kind of API interface, and the communication between the Julia package and the underlying gnuplot process occurs by means of text sent through a pipeline.

As a quick workaround, could you please try other terminals such as the windows or wxt ones (as suggested by @PetrKryslUCSD)?

In any case I will try to reproduce the error on a windows machine, and hopefully fix it.

1 Like

Hello, thanks both of them and nice job for the package.
Finally, the error stopped with @gp "set term windows" !

1 Like