How to configure octave
to use the cygwin version of gnuplot instead of wgnuplot
This short info is about running octave in cygwin under X11
Keywords: cygwin octave X11 x-window gnuplot, without pgnuplot
Plotting in octave is, as is well known, based on gnuplot.
Under cygwin, octave expects to find a program called pgnuplot.exe,
which is just a pipe-handler of connection between octave
and gnuplot inside MS-windows (very tiny program).
What then happens is that octave plots into a wgnuplot, which is
MS-windows version of gnuplot.
Wgnuplot is a useful MS-windows program on its own, and also
necessary when you run octave without explicitely using cygwin
terminal and without x-window.
HOWEVER:
If you set up your Cygwin as a whole GNU-workstation with X-11
and perhaps fvwm2, Wmaker or ICEwm as window manager, use of the
native MS-windows wgnuplot is extremely annoying.
It is however very easy to configure octave to use the cygwin
version of gnuplot, which runs with term = x11, i.e. with the
X-11 display, without MS-windows interference.
I have spent long time trying to figure out how to modify
pgnuplot to talk to cygwin gnuplot, but that is naturally
NOT NECESSARY. Octave can communicate with the cygwin native gnuplot
by emulating succesfully the Unix pipes without any "pgnuplot"
How to do this:
1. in your Cygwin X-installation you must have installed the normal
gnuplot. It is one of the installation options
Under the "release" it sits in the directory
.....ftp-site/release/XFree86/gnuplot/gnuplot-3.8j.0-1.tar.bz2
or whatever the particular version might be.
When installing using Cygwin Setup, gnuplot comes under "math"
2. Provided that you have both Octave and the X11-gnuplot installed:
Locate the
/usr/share/octave/2.1.x/m/startup/octaverc
or perhaps
/usr/local/share/octave/2.1.x/m/startup/octaverc
depending on your version
The file octaverc
contains usually just comments:
======================== octaverc =====================================
## 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.
edit this file like this, i.e. add the two lines
======================== octaverc =====================================
## 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.
gnuplot_binary = "/bin/gnuplot"
gnuplot_has_multiplot = 1
and from now on you will have octave fully inside X-window.
Commenting out these two lines brings you naturally back
to MS-windows wgnuplot display.
You can design various arrangements by using different configuration files,
only your imagination and creativity is a limit here.
Additional information:
I have got the idea how to do this from the site:
http://www.ece.uwaterloo.ca/~ece104/octave/
which however explains just the opposite
The information above comes actually from
Paul Söderlind's Software Page
http://home.tiscalinet.ch/paulsoderlind/Software/Software.html#OctaveInstallation
Installing cygwin (cookbook)
http://galileo.phys.virginia.edu/~rjh2j/p254/software/cygwin/home.html
June 2005. Ladislav Kocbach: ladi[]post.ift.uib.no
http://www.ift.uib.no/~ladi/