问题
I am using the following commands to draw a simple sin(x)
plot on gnuplot , with a pipe from VS2010 C++
set terminal windows
set title 'Graph of velocity versus time'
set xrange[0:10]
plot sin (x)
Problem is the window keeps closing down too quickly . I don't want to use the 'pause' command as it stop the entire code.
Is there any other way to keep this window open without the pause command?
Cheers
回答1:
I cant try it, but have you tried
- setting the terminal to 'set terminal x11'
- set up the terminal to multiple user screens by using 'set terminal windows 0'
- set the output to a png or other image and then use the pipe to open am image viewer programm
The problem is that the command you set via your pipe is probably executed via cmd.exe which exits as soon as gnuplot return 1 (which is totally does after successful plot). With this the instance of the window is destroyed as well.
来源:https://stackoverflow.com/questions/13394371/gnuplot-persist-graph-windows