Gnuplot persist graph windows

不羁岁月 提交于 2020-01-02 19:14:15

问题


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

  1. setting the terminal to 'set terminal x11'
  2. set up the terminal to multiple user screens by using 'set terminal windows 0'
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!