GNUPlot创建后立即消失 [英] GNUPlot disappears immediately after its creation

查看:103
本文介绍了GNUPlot创建后立即消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了gnuplot,但是问题在于它会立即消失.我尝试了其他线程中提出的不同解决方案,但没有一个起作用.解决方案1:注释文件GNUPlotParameters.java中的行bf.append("quit").append(NL);.解决方案2:将gp.setPersist(true);行放在gp.plot();之前.

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();.

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.我正在Windows 7上运行此代码.

P.S. I'm running this code on Windows 7.

推荐答案

不幸的是,这似乎是Windows下gnuplot中的错误. 请参见此错误报告.

Unfortunately this seems to be a bug in gnuplot under windows. See this bug report.

如果您想要这种类型的功能,则有两个选择:

If you want this type of functionality, you have two options:

  1. 使用gnuplot的 CygWin 版本
  2. 将结果保存到文件中,或使用 JPlot swing组件.
  1. use CygWin version of gnuplot
  2. save the result to a file, or use the JPlot swing component.

编辑:有一个新版本的JavaPlot应该可以解决此问题.

EDIT: There is a new version of JavaPlot which should fix this issue.

这篇关于GNUPlot创建后立即消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆