I have created the gnuplot
, but the problem is that it disappears immediately. I tried different solutions proposed in other threads, but none of them worked. Solution 1: comment the line bf.append("quit").append(NL);
in the file GNUPlotParameters.java
. Solution 2: put the line gp.setPersist(true);
before gp.plot();
.
我创建了gnuplot,但问题是它立即消失了。我在其他线程中尝试了不同的解决方案,但没有一个能够工作。解决方案1:注释行bf.append(“quit”)。append(NL);在GNUPlotParameters.java文件中。解决方案2:放行gp.setPersist(true);在gp.plot();之前。
DataSetPlot plotdata = new DataSetPlot(Xvals);
plotdata.setTitle("");
GNUPlot gp = new GNUPlot("C:\\Program Files (x86)\\gnuplot\\bin\\pgnuplot.exe");
gp.addPlot(plotdata);
gp.plot();
gp.setPersist(true);
So, how to solve this problem?
那么,如何解决这个问题呢?
P.S. I'm running this code on Windows 7.
附:我在Windows 7上运行此代码。
1
Unfortunately this seems to be a bug in gnuplot under windows. See this bug report.
不幸的是,这似乎是windows下gnuplot的一个错误。请参阅此错误报告。
If you want this type of functionality, you have two options:
如果您需要此类功能,您有两种选择:
使用CynWin版本的gnuplot
将结果保存到文件,或使用JPlot swing组件。
EDIT: There is a new version of JavaPlot which should fix this issue.
编辑:有一个新版本的JavaPlot应该解决这个问题。
-1
Look into the -persist
option to pass to gnuplot, you could probably change the third line in your code to
查看-persist选项以传递给gnuplot,您可以将代码中的第三行更改为
GNUPlot gp = new GNUPlot("C:\\Program Files (x86)\\gnuplot\\bin\\pgnuplot.exe -persist");
or
GNUPlot gp = new GNUPlot("C:\\Program Files (x86)\\gnuplot\\bin\\pgnuplot.exe /noend");
这是我的来源。
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2013/04/16/4e660bc0f05c7f319f041b80bf387222.html。