Python Gnuplot 5.0';设置输出文件名';在gnuplot中,脚本不起作用

Python Gnuplot 5.0';设置输出文件名';在gnuplot中,脚本不起作用,python,gnuplot,Python,Gnuplot,我是Gnuplot的新手,从gnuplot5.0.0开始。我的问题是: 考虑一个非常简单的GNUTRAP脚本示例,名为Save.GPL: 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终端my mac(OX 10.0)运行此脚

我是Gnuplot的新手,从gnuplot5.0.0开始。我的问题是: 考虑一个非常简单的GNUTRAP脚本示例,名为Save.GPL:

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终端my mac(OX 10.0)运行此脚本时:
$gnuplot save.gpl
它在第4行(设置输出“graph.png”)中抛出一个错误,表示:

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

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

但是如果我在“gunplot>”模式下一次执行脚本中的每个命令,一切都会正常进行

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


提前感谢。

您使用了错误的引号。您的脚本中有和,这是错误的

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

set terminal pngcairo
set output "graph.png"
plot sin(x)

明白了,克里斯,谢谢。