Gaston.jl icon indicating copy to clipboard operation
Gaston.jl copied to clipboard

gnuplot crashes when creating basic plot

Open fbanning opened this issue 5 years ago • 5 comments

In response to a Zulip conversation

julia> using Gaston

julia> a = 1:0.1:10
1.0:0.1:10.0

julia> plot(a)
Error showing value of type Gaston.Figure:
ERROR: Gnuplot crashed
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] llplot(F::Gaston.Figure; printstring::Nothing)
    @ Gaston ~\.julia\packages\Gaston\ctAQy\src\gaston_llplot.jl:174
  [3] llplot
    @ ~\.julia\packages\Gaston\ctAQy\src\gaston_llplot.jl:107 [inlined]
  [4] display(x::Gaston.Figure)
    @ Gaston ~\.julia\packages\Gaston\ctAQy\src\gaston_aux.jl:87
  [5] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
  [6] invokelatest
    @ .\essentials.jl:706 [inlined]
  [7] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Uni
on{Nothing, AbstractDisplay})
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:247
  [8] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:231
  [9] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:462
 [10] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:229
 [11] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL, REPL.REPLHistoryProv
ider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:798
 [12] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [13] invokelatest
    @ .\essentials.jl:706 [inlined]
 [14] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.Li
neEdit.MIState)
    @ REPL.LineEdit C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\LineEd
it.jl:2441
 [15] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:1126
 [16] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:406

Using gnuplot and creating a demo plot with it works perfectly fine though.

Specs: Win10, Julia 1.6.0, gnuplot 5.4.1 Gaston.config:

Dict{Symbol, Any} with 8 entries:
  :mode     => "normal"
  :termopts => ""
  :showable => "png"
  :debug    => false
  :saveopts => ""
  :preamble => ""
  :timeout  => 20
  :term     => "windows"

fbanning avatar Mar 29 '21 10:03 fbanning

Thanks for the report.

Gaston interacts with gnuplot uisng the stdin/stdout/stderr streams. The problem is likely that these are broken in Windows for Julia 1.6.0.

I will try to reproduce this and figure out the cause. It may take some time, though, since I don't work much on Windows.

mbaz avatar Mar 29 '21 15:03 mbaz

Initial tests on Windows 10 seem to indicate that gnuplot 5.4.1 crashes when using the Windows terminal.

mbaz avatar Apr 13 '21 19:04 mbaz

If you have a chance, could you please try:

using Gaston
set(term = "qt")
plot(1:10)

mbaz avatar Apr 13 '21 19:04 mbaz

Yes, qt terminal seems to work and a plot window opens.

However, I also get the following warning:

┌ Warning: Gnuplot returned an error message:
│
│ Warning: slow font initializationqt_processTermEvent received a GE_fontprops event. This should not
have happened
└ @ Gaston C:\Users\Frederik Banning\.julia\packages\Gaston\ctAQy\src\gaston_llplot.jl:182

fbanning avatar Apr 14 '21 13:04 fbanning

This is a known problem; see the Gnuplot FAQ here: http://www.gnuplot.info/faq/

One option is to start gnuplot with -slow in Windows and Mac, and see if that helps. A second option is to fall back to the wxt terminal. Could you try plotting in a fresh session, but with set(term="wxt")?

mbaz avatar Apr 14 '21 21:04 mbaz