[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave's graphics interface / linux operating system
From: |
Sergei Steshenko |
Subject: |
Re: octave's graphics interface / linux operating system |
Date: |
Mon, 12 May 2008 14:46:45 -0700 (PDT) |
--- Stefan Pofahl <address@hidden> wrote:
> Hello Sergei,
>
> this is to me a bit to cryptic, can you provide a practical
> example?
>
> Regards,
>
> Stefan
>
> ***
>
> 2008/5/12, Sergei Steshenko <address@hidden>:
> >
> >
> > --- David Bateman <address@hidden> wrote:
> >
> > > Dieter Jurzitza wrote:
> >
> >
> >
> > Well, 'octave' has 'gnuplot_binary' command.
> >
> > Using it one can use gnuplot impersonator which intercepts octave's STDOUT
> > with 'gnuplot'
> > commands - I used to have a Perl script doing this and writing its STDIN
> > to file, parsing it on
> > the fly.
> >
> > Regards,
> > Sergei.
> >
> >
> > Applications From Scratch: http://appsfromscratch.berlios.de/
> >
> >
> >
> >
> >
> > ____________________________________________________________________________________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
> >
>
>
>
> --
> Tel.: 0731-3805149
> Ochsensteige 48
> 89075 Ulm
>
Well, with the attached example it will probably be even more cryptic :-) ...
The idea of the script was:
1) to store data sent to 'gnuplot' in temporary files;
2) when actual 'plot' command is encountered, to call 'gnuplot' with the
temporary
files.
For this particular script to work I had to slightly change 'octave' plotting
routines
to produce more easily parseable output.
This all was done in order to enable mouse zooming - the released gnuplot-4.2.3
does
not have mouse zooming woeking when input comes to it through STDIN; recent
binary
snapshots have this problem resolved, so I do not need the script anymore.
Anyway, in the attached script 'main_loop' routine iterates over STDIN lines,
separating
the stream into commands - see $commands_file, $_commands_file_fh and data - see
$data_file, $_data_file_fh.
The
152 $line =~ s/^"-"/"$data_file"/;
line substitutes "-", i.e. the instruction for 'gnuplot' to accept data from
STDIN
with "$data_file", i.e. the instruction for 'gnuplot' to accept data from
$data_file.
The script was a hack, but it illustrates the idea of intercepting STDIN.
...
For your purposes you can probably also specify 'gnuplot' using
'gnuplot_binary' more
or less this way:
gnuplot_binary("| tee gnuplot_input.txt | /actual/path/to/gnuplot");
or just
gnuplot_binary("| tee gnuplot_input.txt | gnuplot");
- in the above 'tee' will both write everything sent to 'gnuplot' to
'gnuplot_input.txt' file and
will send to 'gnuplot' what's been sent to it by 'octave'.
Try http://linux.die.net/man/1/tee to read 'tee' manpage.
Regards,
Sergei.
Applications From Scratch: http://appsfromscratch.berlios.de/
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
gnuplot_impersonator.pl
Description: 161335766-gnuplot_impersonator.pl
- Re: octave's graphics interface / linux operating system, (continued)
- Re: octave's graphics interface / linux operating system, Sergei Steshenko, 2008/05/15
- Re: octave's graphics interface / linux operating system, John W. Eaton, 2008/05/14
- Re: octave's graphics interface / linux operating system, soren, 2008/05/14
- Re: octave's graphics interface / linux operating system, Francesco Potorti`, 2008/05/14
- Re: octave's graphics interface / linux operating system, John W. Eaton, 2008/05/14
- Re: octave's graphics interface / linux operating system, Sergei Steshenko, 2008/05/15
- Re: octave's graphics interface / linux operating system, Francesco Potorti`, 2008/05/15
Re: octave's graphics interface / linux operating system, Sergei Steshenko, 2008/05/12
Re: octave's graphics interface / linux operating system, Francesco Potorti`, 2008/05/12