How to write to stdout with gnuplot's print statement?

喜夏-厌秋 提交于 2019-12-21 03:47:21

问题


When I use the following in my script, gnuplot will print test to stderr:

print "test"

However, I want to write test to stdout as only errors should be written to stderr.


回答1:


As stated in the gnuplot docs (type help print in interactive gnuplot console):

The output file can be set with set print.

So, let's look up set print:

Without "<filename>", the output file is restored to <STDERR>. The <filename> "-" means <STDOUT>.

So simply add a set print "-" at the top of your gnuplot script and everything printed by the print-statement is written to stdout.



来源:https://stackoverflow.com/questions/27375956/how-to-write-to-stdout-with-gnuplots-print-statement

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