我有以下代码:管道到GNUPLOT,不接受多个命令
fprintf(temp->_fstream, "plot '-' using 1:2 title 'tittle1'\n");
_fstream
是gnuplot的管,使用“ - ”使得能够将数据写入GNUPLOT直接而不是先写它到文件,这是做的代码:
fprintf (_stream->_fstream, "%d ", _node->count);
现在我想绘制另一个两列说1:3,例如在gnuplot的,你会使用这样做:
plot "output3.txt" using 1:2 title 'prey', "output3.txt" using 1:3 title 'predator'
,但通过它给出了一个错误说unreachable data source
这里的管道做同样的事情是,我使用的线:
fprintf(temp->_fstream, "plot '-' using 1:2 title 'tittle1', '-' using 1:3 ... \n");
我一直在看这一段时间的任何帮助,将不胜感激。
您可能需要创建一个伪TTY,使gnuplot的行为,如果是在交互模式。 – 2012-03-03 23:25:02