1

I run the command

/usr/local/bin/gnuplot -e set terminal png; set output bench.png; plot '/Users/masi/0deg/loop_data.txt' u 1:2

giving the error

set
   ^
line 0: unrecognized option - see 'help set'.

I set the setting of the terminal and output because I realized from this answer, here, that they are required. I run the same command in Bash and Zsh unsuccessfully by getting exactly the same error message.

I run

/usr/local/bin/gnuplot -e "set terminal png; set output bench.png; plot '/Users/masi/0deg/loop_data.txt' u 1:2"

and I get

line 0: internal error : STRING operator applied to non-STRING type

How can you run plotting of a figure directly in terminal for gnuplot?

1 Answer 1

2

You need to add some double quotes around the command:

/usr/local/bin/gnuplot -e "set terminal png; set output 'bench.png'; plot '/Users/masi/0deg/loop_data.txt' u 1:2"

Without the double quotes, only the first word is being interpreted as the entire script, which is leading to the error you are experiencing.

You also need to use quotes around your output file name, which solves your second problem. The issue here is that gnuplot is interpreting bench as a variable name and attempting to do a string concatenation.

Sign up to request clarification or add additional context in comments.

2 Comments

I updated the body. Internal error. I think this may be now my memory problem. I try to free up some space and see what I get now. Your command should be correct.
Works now! I had also a memory problem which confused me about the error messages. Thank you for your answer!

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.