plotting from within octave "scripts"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

plotting from within octave "scripts"

Harikrishna R
Hi,

I was trying to write self-contained scripts in octave via the #!
facility. Everything seems to work fine except for plotting commands -
gnuplot window does not come up.  The script (program, rather) works fine,
plotting and all, when run from an octave interactive prompt. What could
be the problem?

Here's my configuration:
[7: 0] uname -a
SunOS nirvana 5.5.1 Generic_103640-24 sun4m sparc SUNW,SPARCstation-20

I downloaded the source and compiled it using Sun's compilers.

Thanks,
harik



Reply | Threaded
Open this post in threaded view
|

Re: plotting from within octave "scripts"

Stefano Ghirlanda

> I was trying to write self-contained scripts in octave via the #!
> facility. Everything seems to work fine except for plotting commands -
> gnuplot window does not come up.  The script (program, rather) works fine,
> plotting and all, when run from an octave interactive prompt. What could
> be the problem?

it might be that your script is very quick in executing. the gnuplot
instance that octave talks to is "internal" to each octave run, as soon as
the script finishes executing gnuplot dies, and your plot with it.
If this is the case, look at the help for 'pause' within gnuplot. You may
send a graw("pause") command at the end of your script (i don't remember
if graw() has been included in the stable distribution)

Stefano

 Stefano Ghirlanda, Zoologiska Institutionen, Stockholms Universitet
    Office: D554, Arrheniusv. 14, S-106 91 Stockholm, Sweden
Phone: +46 8 164055, Fax: +46 8 167715, Email: [hidden email]
   Support Free Science, look at: http://rerumnatura.zool.su.se



Reply | Threaded
Open this post in threaded view
|

Re: plotting from within octave "scripts"

John Smith-74
In reply to this post by Harikrishna R
On Mon, 17 May 1999, Harikrishna R wrote:

> Hi,
>
> I was trying to write self-contained scripts in octave via the #!
> facility. Everything seems to work fine except for plotting commands -
> gnuplot window does not come up.  The script (program, rather) works fine,
> plotting and all, when run from an octave interactive prompt. What could
> be the problem?
>

Or you might try
   #! /usr/local/bin/octave
   aa=linspace(0,10,100) ;
   bb=sin(a) ;
   gnuplot_binary='gnuplot -persist'
   plot(aa,bb) ;

John