help-octave
[Top][All Lists]
Advanced

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

Re: windows version of Octave


From: Doug Stewart
Subject: Re: windows version of Octave
Date: Mon, 23 May 2005 09:32:46 -0500
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

My apologies to all, I just realized that this help file wasn't written by Andy Adler.
Doug Stewart

Doug Stewart wrote:

John W. Eaton wrote:

On 22-May-2005, Andy Adler wrote:

| To summarize, cygwin octave works, but has several issues that make it
| less than optimal.

Yes, there are problems.  Some of them don't seem so easy to fix.  But
while we are worrying about how to fix them, we can build a
sub-optimal Cygwin version of Octave.  If it is included in the
default set of Cygwin packages on the Cygwin web site, people will
have something to use that is up to date.  Keeping it current should
not be too much trouble.  It won't be perfect (we can work on that
over time) but at least we shouldn't have Windows users complaining
about the bugs in really old versions of Octave.

jwe
I have octave-2.1.71 running, compiled with gcc-3.3.3
with
./configure
and with
./configure --enable-shared --disable-static

The next step for me to get going is gnuplot?
Andy, I have your 2003 instructions and I think I can get gnuplot running the way you did,
but I am not sure how to get a newer version of gnuplot working.

you said
"
Currently there are two options to invoke gnuplot from Octave:

   * pipe-gnuplot.exe
   * pgnuplot.exe

"

How should I be doing it now???


here is what I have been reading:

doug Stewart






*/Step 5. Download gnuplot/*

Point your web browser to www.gnuplot.info <http://www.gnuplot.info>, select a mirror site and and download the file gp371cyg.zip or gp371w32.zip (or a later version indicated to be a Win32 binary for Cygwin).

As this is a regular Windows ZIP-archive, you can unpack it using Winzip <http://www.winzip.com> or another archive program supporting ZIP format. After unpacking, follow the instructions for installation of gnuplot.

Note 1: Installation of gnuplot in the C:\Program Files directory (where most Windows programs are stored) is no problem for Octave, nor for many other Linux programs run from the Cygwin Linux emulator which might need gnuplot. As installation under C:\Program Files is a /de facto/ convention for many a Windows package, just put gnuplot there to avoid cluttering up your hard drive's root directory.

Note 2: Depending on the actual gnuplot package, it will install also a subdirectory with a number of demo files. These are quite worthwile, as gnuplot is also just by itself a very powerful program. After Octave has made a plot by invoking gnuplot, you can use the gnuplot command window to further enhance the picture.

If you insist on doing it the hard way, you can also download the gnuplot source code and build gnuplot yourself. I have not done this, so you are on your own if you want to try it.

*/Step 6. Connect gnuplot to Octave, and other nitty-gritty/*

Some small things remain and need careful attention:

  1. Connecting gnuplot to Octave (or vice versa) using the program
     pipe-gnuplot;
  2. Revamping the terminal (something like a DOS box) where Octave
     runs in;
  3. Making a shortcut to the Windows desktop and/or Start menu;
  4. Enabling the function of the Del, Backspace, Insert and arrow keys.

_1A. Connecting gnuplot to Octave (or vice versa) using the program pipe-gnuplot_

Some things to know in advance:

  1. Octave uses gnuplot for graphical output. However, because Octave
     and gnuplot have no native way of communication, Octave sends
     gnuplot some commands and information through a mechanism called a
     "pipe". This mechanism comprises a one-way communication: Octave
     can send info to gnuplot, but not the other way round;
  2. When graphical output is requested by the Octave user, Octave
     opens two windows:
         * A graphical output window
         * A gnuplot command window, where much of the commands sent by
           Octave can be inspected and -if needed- edited and then
           re-issued to gnuplot;
  3. If needed, Octave-for-Windows starts up gnuplot and initializes
     the connection, but it does so only once per session. Therefore,
     you should not close down the gnuplot command window yourself (but
     you can close the gnuplot graph window);
  4. Likewise, Octave closes down the gnuplot windows if Octave itself
     is exited.
  5. The way Octave communicates with gnuplot imposes restrictions on
     graphical output. Several obviously needed options are simply
     unavailable. Contouring is a notable problem. Mouse interaction is
     not possible (but see below for a gnuplot 3.8 version which has
     preliminary mouse support). Volunteers are needed to make all this
     possible, so if you got some spare time, motivation and
     programming skills, please sign up with the appropriate project
     leaders.

Currently there are two options to invoke gnuplot from Octave:

   * pipe-gnuplot.exe
   * pgnuplot.exe

  1. _pipe-gnuplot.exe_
     You need to get the program pipe-gnuplot.exe (it must be put in a
     directory in the PATH, i.e. in /bin or /usr/local/bin). You can do
     a web search for it; mid-2003 it could be found at:
     http://www.ecs.shimane-u.ac.jp/~kyoshida/octave_installeng.htm
     <http://www.ecs.shimane-u.ac.jp/%7Ekyoshida/pipe-gnuplot.exe>
     (A version of) the source code is below
     <cid:part1.07040709.04050307@sympatico.ca>.)
     OK, in the file /usr/local/share/octave/site/m/startup there
     should be a file called octaverc. This file contains some
     important startup settings for Octave.

     Take any text editor (Windows or Linux) and make sure that the
     following lines get into octaverc (adapted from Tom C. Weichmann's
     version):

     ## System-wide startup file for Octave.
     ##
## This file should contain any commands that should be executed each
     ## time Octave starts for every user at this site.
     ##############################################################
     ## Please Do Not Change These Settings
     ## They Are Needed For Proper Operation on The Win32 Platform
     gnuplot_binary = 'pipe-gnuplot wgnuplot.exe';
     putenv('TMPDIR','C:/Cygwin/tmp');
     # gnuplot_has_multiplot = 1
     ##############################################################

     (Make any necessary changes if your directory structure is
     different - take care of upper- and lower case characters. If
     wgnuplot is not (yet) in your Cygwin path but somewhere else in
     the Windows subdir hierarchy, enclose the path to wgnuplot.exe in
     quotes or just add the necessary subdir to your PATH. E.g., here's
     my PATH:
     $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Program Files/gnuplot/gp371cyg:/cygdrive/c/WINNT/SYSTEM32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/SYSTEM32/WBEM:


     N.B. As you can see I used the implicit Cygwin mounts /cygdrive/c
     to refer to Windows drive/partition C:\

     (Also note that the last line is commented out. This line
     indicates that the gnuplot graph window must not be erased before
     redrawing, but that next plots must simply be added to it.
     However, you can also set this from the Octave terminal. I would
     prefer to have it commented out.)

  2. _pgnuplot.exe_
     See below under "Other gnuplot options".

_1B. Adapting the search path for gnuplot_

In the directory /etc there should be a file called profile. This file should contain at least the following lines, or lines meaning the same as these lines:

export PATH=/bin:/usr/local/bin:/gnuplot3.7.1:$PATH
export HOME=/home/$USER

(again, change paths and/or file names if appropriate. If the path to gnuplot (here /gnuplot3.7.1, or in Windows parlance c:\cygwin\gnuplot3.7.1) contains spaces, enclose it in quotes). This file merely appends some directories to your implicit Cygwin-PATH (which is different than your Windows/DOS search PATH). The important item here is obviously the gnuplot subdirectory.

That should do - if you now (re-) start Octave, you should be able to use gnuplot. Try the following command from an Octave window:

gplot rand (100,1) with linespoints

After a while the title bar of your bash shell should show "pipe-gnuplot", and after some time a graphics window containing a 2D-plot should appear. Don't close the gnuplot window yourself, Octave will do that as soon as you quit Octave.

*/Other gnuplot options/*

PaulSöderlind suggested to download *gp371w32.zip* rather than *gp371cyg.zip*, because the former has pipe-gnuplot built in and so avoids invoking pipe-gnuplot altogether. Instead of a separate pipe-gnuplot.exe, this package now contains a pgnuplot.exe which -additionally- may give a better pipe.

In the octaverc file (in /usr/local/share/octave/site/m/startup) the line

gnuplot_binary = 'pipe-gnuplot wgnuplot.exe';     can be replaced by:

gnuplot_binary = pgnuplot.exe;

(assuming pgnuplot.exe and wgnuplot.exe are in a directory in the PATH).
However, in the help-octave mailing list appeared some messages <http://www.octave.org/mailing-lists/help-octave/2002/237> that under Windows 2000 and Windows XP, the pgnuplot driver was not working properly, probably due to a bug in the gp371w32.zip package. So, on this web page I still feature the "classical" way of linking gnuplot to Octave using pipe-gnuplot.

A somewhat newer version of gnuplot (3.8.i) -but still beta quality- including PM3D <http://www.sci.muni.cz/%7Emikulik/gnuplot.html#PM3D> and mouse support, can be found on the Web. E.g., in May 2003, using a Google <http://www.google.com> search, I found one here <http://www.sci.muni.cz/%7Emikulik/gnuplot/> (use the ...winbin.zip version).




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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