help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnuplot scripts as output?


From: Tatsuro MATSUOKA
Subject: Re: Gnuplot scripts as output?
Date: Fri, 2 Apr 2010 11:11:29 +0900 (JST)

Hello

--- Tribo Laboy  wrote:

> Hello!
> 
> I am also quite interested in the possibility to reuse gnuplot files
> created by octave.
> 
> On my windows version of Octave 3.2.3-2 from source-forge coming with
> gnuplot  4.3.0-2009-07-08 CVS patchlevel 0 octave-mingw32 I do the
> following:
> 
> x = 0:0.1:16; y = sin(x);
> plot(x,y)
> drawnow ("windows", "NUL", false, "gnuplotstream.plt")
> 
> as a result I get a "gnuplotstream.plt" file in the current dir, but
> when trying to open it in gnuplot, it does nothing. No error, nothing.
> I open the file in a text editor a found that some of the data is
> binary. Could that be the problem?
> 
> I would appreciate if someone sheds some light on this. Does it work
> on Linux and how to make it work on Win?

Gnuplot for window seems not to accept the binary data like

plot "-" binary format='%float64' record=161 using ($1):($2) axes x1y1 title "" 
with lines linestyle 1
\
;
(binary data)

by load command.

However,
After the following

x = 0:0.1:16; y = sin(x);
plot(x,y)
drawnow ("windows", "NUL", false, "gnuplotstream.plt")
close

Type
system('cmd')

and then goto command prompt of cmd.
At the command prompt

copy gnuplotstream.plt tmp.plt
echo pause 5 >> tmp.plt
type tmp.plt | gnuplot
del tmp.plt

worked.  (I have confirmed octave-3.2.4/mingw32)

The 'pause 5' means 5 seconds wait.  Please change it as you like.
Do not use 'pause -1' because one cannot send 'enter' code interactively via 
pipe.


The below is a screen shot as an example

*******************************************
octave:7> x = 0:0.1:16; y = sin(x);
octave:8> plot(x,y)
octave:9> drawnow ("windows", "NUL", false, "gnuplotstream.plt")
octave:10> close
octave:11> system('cmd')
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

D:\usr\Tatsu\program\Octave\test2>copy gnuplotstream.plt tmp.plt
        1 file(s) copied.

D:\usr\Tatsu\program\Octave\test2>echo pause 5 >> tmp.plt

D:\usr\Tatsu\program\Octave\test2>type tmp.plt | gnuplot

D:\usr\Tatsu\program\Octave\test2>del tmp.plt

D:\usr\Tatsu\program\Octave\test2>
*******************************

Hope the above helps

Good luck!!

Tatsuro

--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]