[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave won't plot from script file
From: |
Ben Abbott |
Subject: |
Re: Octave won't plot from script file |
Date: |
Sat, 01 Jan 2011 21:29:51 -0500 |
On Jan 1, 2011, at 9:05 PM, Glen Shennan wrote:
> Hi,
>
> I'm trying to run script files which aim to produce plots using Octave with
> the plot() function. When I run the files using QtOctave the plot appears
> fine, as it does when I run octave from a terminal then invoke the script
> from the Octave prompt.
>
> So
>
> ~$ octave
> octave:1> script.m
>
> does work but
>
> ~$ octave script.m
>
> does not. I'm using Ubuntu 10.04 with Octave 3.2.4 and GNUPlot 4.4. I've
> been searching for hours and I keep seeing problems which look similar to
> this and I've tried many fixes ("set terminal x11 -persist" in .gnuplot etc.)
> but nothing I've done has produced any change in behaviour at all. Is there
> anything I've missed?
>
> Thanks, and a happy new year to you all!
Are you sure you have that correct. Your example below will give an error.
octave:1> script.m
script.m
error: `script' undefined near line 8 column 1
Octave will interpret "script" to be a structure and "m" to be a field on that
structure.
To run your script from a shell, you can add an option to allow octave to go
interactive after running your script.
$ octave --persist script.m
Or you can add "pause()" to the script. The plot window will then stay open
until after you hit <return>
Ben