4

I want to call gnuplot with a shell command, all the commands are stored in, let's say, "load.gp".

If I start the gnuplot shell and type "load 'load.gp'" I can change the viewpoint by dragging the splot with the mouse around.

The Problem is, I can't figure out how to reach that without being in the gnuplot shell.

echo "load 'load.gp'" | gnuplot -persist

or

gnuplot -persist 'load.gp'

won't work. Can somebody help me?

Thanks, Jan

3 Answers 3

2

I think

gnuplot load.gp -

does what you want.

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

Comments

1

You need to add an hyphen after the command, e.g.

gnuplot -persist 'load.gp' -

As mentioned here: http://old.nabble.com/gnuplot-in-persist-mode-td28289021.html

Comments

0

The command

gnuplot -persist load.gp

should do the trick just fine...

Sounds like you have some error in your load.gp file. Try setting the terminal in your load.gp file. Perhaps it the terminal remains unset or is set to a terminal incompatible with the commands in y our file. all fail, post your load.gp file here, and let's have a look at it :)

/B2S

4 Comments

This is the correct way to keep the plot displayed but the gnuplot prompt is not presented to the user.
Indeed, as he requested. I don't see why this answer was voted down... surely if he doesn't get the desired results, an error in his load.gp file is a plausible reason.
As I interpret it, the OP would like to be able to run a script and have that run finish with a zoomable plot. Persist does not, at present, allow zooming.
That depends entirely on the terminal you choose to use. Using the 'wxt' terminal allows zooming just fine with the -persist flag

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.