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
1.4 Is gnuplot suitable for scripting? Yes. Gnuplot can read in files containing additional commands during an interactive session, or it can be run in batch mode by piping a pre-existing file or a stream of commands to stdin.
There are two ways to save your work in gnuplot: you can save the gnuplot commands used to generate a plot, so that you can regenerate the plot at a later time. Or you can export the graph to a file in a standard graphics file format, so that you can print it or include it in web pages, documents, or presentations.
png output) gnuplot> set output "printme. png" (output to any filename. png you want) gnuplot> replot gnuplot> set term x11 You can view it with some viewer, or on a browser, or print it... or import it in PowerPoint or whatever you want to do with it.
5.9 Does gnuplot support multiple y-axes on a single plot? Yes. 2D plots can have separate x axes at the bottom (x1) and top (x2), and separate y axes at the left (y1) and right (y2).
If you want the plotting window to remain open, you must call gnuplot with the -persist
flag:
gnuplot -persist myPlot
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With