新的 gnuplot (5.x) 具有新的逻辑语法,但我无法使用“else if”语句。例如:
if(flag==1){
plot sin(x)
}
else{
plot cos(x)
}
Run Code Online (Sandbox Code Playgroud)
确实有效,但是:
if(flag==1){
plot sin(x)
}
else if(flag==2){
plot cos(x)
}
else if(flag==3){
plot tan(x)
}
Run Code Online (Sandbox Code Playgroud)
才不是。我尝试了 {} 的多种组合以及“if”和“else”的放置,但都无济于事。有谁知道如何在 gnuplot 5.x 中正确实现“else if”?
gnuplot 指南 ( http://www.bersch.net/gnuplot-doc/if.html ) 没有使用“else if”的新逻辑语法示例,但确实有使用旧语法的示例,但我宁愿避免使用老的。