gnuplot脚本中的Gnuplot 5.0'设置输出文件名'不起作用

时间:2015-09-17 21:33:00

标签: python gnuplot

我是Gnuplot的新手,从gnuplot 5.0.0开始。这是我的问题: 考虑一个名为save.gpl的gnuplot脚本的简单示例:

set terminal dumb  
plot sin(x) with linespoints pointtype 5, cos(x) w boxes lt 4  
set term png   
set output “graph.png”   
replot  
set term dumb

当我尝试从shell终端我的mac(OX 10.0)运行这个脚本时:
$ gnuplot save.gpl
它在第4行(设置输出“graph.png”)中抛出错误说:

  

“save.gpl”,第4行:内部错误:STRING运算符应用于非STRING类型。

当我尝试从gnuplot加载脚本时,会发生同样的事情: gnuplot>加载save.gpl

但是如果我在“gunplot>”中一次一个地执行我的脚本中的每个命令模式,一切都很顺利。

但是,我需要使用 设置输出“filename.png” 更多大型脚本中的语句多次保存几个图。因此,必须在脚本中使用此语句。

提前致谢。

1 个答案:

答案 0 :(得分:3)

您使用的是错误的引号。在您的脚本中,您有LEFT DOUBLE QUOTATION MARK (U+201C)RIGHT DOUBLE QUOTATION MARK (U+201D),这是错误的。

您必须将'(ASCII 0x27)或双引号"(ASCII 0x22)作为字符串分隔符,就像使用任何脚本语言一样。

set terminal pngcairo
set output "graph.png"
plot sin(x)
相关问题