1
votes

I'm writing a script in the octave programming language that calls plot. When I open the octave console in interactive mode and paste the script in, gnuplot appears correctly. However, when I run the script from a command line via

octave ./myscript.m

all printf work, but no gnuplot window appears. This happens with as simple a script as

plot([0 1; 2 3])

Any ideas why this might be happening?

Thanks.

1
What system are you using? Windows or linux. If I memeber correctly octav pipes your commands via a file stored in /tmp/ (on Linux). Looking at those might give you a clue as to what's going on. Hmm, can't find a link for this though, will have a look - Tom

1 Answers

4
votes

Try running the script with the --persist flag. This flag tells Octave to "go to interactive mode after
--eval or reading from a file named on the command line."

> octave --persist ./myscript.m