11
votes

I have a gnuplot script. My system is ubuntu 14.04. When In the terminal I type gnuplot myPlot. The plot will disappear. It is not remain on the screen. I this stack in saw similar question. But its system is windows. I want to know is there any solution for that on ubuntu 14.04 32 bit

PS: when I use gnuplot>-- I mean when I do not use script file-- I see the diagram and it does not disappear.

PS2 : this is my simple gnuplot script file :

set boxwidth 0.5
set style fill solid
plot "dataFile" using 1:2:xtic(2) with boxes
3

3 Answers

16
votes

If you want the plotting window to remain open, you must call gnuplot with the -persist flag:

gnuplot -persist myPlot
12
votes

There are already nice answers here, but the -persist flag did not work for me and enabling x11 force GnuPlot to use crapy XQuarts for windowing instead of beloved Qt. What worked for me was the

pause -1

command (from here) at the end of the script. According to the documentation

pause -1 # Wait until a carriage return is hit

I hope it helps.

9
votes

If you do not want to call gnuplot with the extra argument (-persist), you can enable this functionality within your script, e.g.

set term x11 persist