3

I am newbie to Gnuplot, and starting with gnuplot 5.0.0. Here is my problem: Consider very simple example of a gnuplot script named 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

When I try run this script from the shell terminal my mac (OX 10.0):
$ gnuplot save.gpl
it throw a error in line 4 (set output “graph.png”) saying:

"save.gpl", line 4: internal error : STRING operator applied to non-STRING type.

Same thing happens when I try to load my script from the gnuplot: gnuplot > load save.gpl

But if I execute each command in my script one at a time in the "gunplot >" mode, everything goes fine.

However, I need to use set output “filename.png" statements in a lot bigger script several times to save several plots. So, have to use this statement in the script.

Thanks in advance.

1 Answer 1

3

You are using the wrong quotes. In your script you have the LEFT DOUBLE QUOTATION MARK (U+201C) and the RIGHT DOUBLE QUOTATION MARK (U+201D), which is wrong.

You must single ' (ASCII 0x27) or double quotes " (ASCII 0x22) as string delimiters, like you do in any scripting language.

set terminal pngcairo
set output "graph.png"
plot sin(x)
Sign up to request clarification or add additional context in comments.

1 Comment

Got it, Chris. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.