help-octave
[Top][All Lists]
Advanced

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

Re: gnuplot_x11 driver with octave.app/gnuplot.app on Mac


From: Thomas Treichl
Subject: Re: gnuplot_x11 driver with octave.app/gnuplot.app on Mac
Date: Sat, 11 Aug 2007 14:08:09 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Ok Henry, sorry I misunderstood some things - and I hope I understand it right now ;) Thanks for the detailed explanation.

I've attached the modified startup script for Gnuplot.app, please replace

  /Applications/GnuPlot.app/Contents/Resources/bin/gnuplot

with my attached file. Then take an unmodified Octave.app and download the current version of drawnow.m from the CVS site

http://velveeta.che.wisc.edu/cgi-bin/cvsweb.cgi/octave/scripts/plot/drawnow.m

and replace

/Applications/Octave.app/Contents/Resources/share/octave/2.9.13/m/plot/drawnow.m

Then this works for me:

  bash$ export GNUTERM=x11
  bash$ octave # I just have Octave.app
  octave-2.9.13:1> plot ([1:10]) # Starts up X11 and plots in XWindow

If you don't like the xterm window that opens automatically when X11 is started then edit /etc/X11/xinit/xinitrc. Please tell me if this works for you...

  Thomas

Henry F. Mollet schrieb:

Thomas,

There would be no problem if I cannot toggle between X11 and AquaTerm as I
can always run two different terminal windows to do it.

'octave-2.1.71/gnuplot-4.0' was installed from source. Was about 2 dozen
steps if I include all the dependencies that were needed.

'octave-2.1.71/gnuplot-4.0' does *not* open the X11 application
automatically but that's not a problem because I can open it.

My problem still is case #3 below, namely Octave-2.9.13/Gnuplot-4.2. It does
trigger X11 to open but it uses AquaTerm instead of X11 to do the graph.

Below are the 4 cases, first the summaries, then the copy/paste from the Max
Terminal window.
Henry

1. Gnuplot 4.2 will open X11 when starting out in a Mac Terminal window.  I
can get a graph in the X'Gnuplot' window.

2. Gnuplot 4.0 will NOT open X11, I have to open it. Then I can get a graph
in the X'Gnuplot' window.

3. Octave-2.9.13/Gnuplot-4.2 will open the X11 application (including an
xterm window that I don't need) *but* the graph will appear in AquaTerm. I
just cannot get the graph in an X'Gnuplot' window.
*This is the problem that I cannot solve*.

4. Octave-2.1.71/Gnuplot-4.0 does not open an X11 window  and I do have to
open the X11 application if I want a graph. The graph will appear in the
X'Gnuplot' window.

*******************************************
1. Gnuplot 4.2
Last login: Fri Aug 10 15:12:39 on ttyp2
Welcome to Darwin!

 [~] -bash-2.05b 500$ export GNUTERM=x11
 [~] -bash-2.05b 501$ exec
'/Applications/GnuPlot.app/Contents/Resources/bin/gnuplot'

        G N U P L O T
        Version 4.2 patchlevel 0
        last modified March 2007
        System: Darwin 8.10.0

Terminal type set to 'x11'
gnuplot> ## This will have opened the X11 application with an xterm window with the
following prompt:
henry-f-mollets-emac:~ hfm$
I could use this xterm window but don't need it to do a Gnuplot graph
because gnuplot is already open in the Terminal window. Importantly, the X11
application has been opened.

gnuplot> plot sin(x)
Will now give a graph in an X'Gnuplot' window.
**********************************************
2. Gnuplot 4.0
Last login: Fri Aug 10 15:21:04 on ttyp1
Welcome to Darwin!

 [~] -bash-2.05b 500$ export GNUTERM=x11

 [~] -bash-2.05b 501$ gnuplot

        G N U P L O T
        Version 4.0 patchlevel 0
        last modified Thu Apr 15 14:44:22 CEST 2004
        System: Darwin 8.10.0

 Terminal type set to 'x11'
gnuplot> plot sin(x)

gnuplot: unable to open display ':0.0'
gnuplot: X11 aborted.

##If I now open the X11 application the graph will appear in an X"Gnuplot"
window.
*****************************************
3. Octave-2.9.13/Gnuplot-4.2
Last login: Fri Aug 10 15:55:52 on ttyp2
Welcome to Darwin!

 [~] -bash-2.05b 500$ export GNUTERM=x11

 [~] -bash-2.05b 501$ exec
'/Applications/Octave.app/Contents/Resources/bin/octave'
GNU Octave, version 2.9.13

octave-2.9.13:1> ##X11 has not been opened yet
octave-2.9.13:1> plot (1:20)
##This will open the X11 Application (with an xterm window that I don't
need) *but* the graph will appear in AquaTerm.
octave-2.9.13:2>
******************************************
4. Octave-2.1.71/Gnuplot-4.0
Last login: Fri Aug 10 15:48:32 on ttyp1
Welcome to Darwin!

 [~] -bash-2.05b 500$ export GNUTERM=x11

 [~] -bash-2.05b 501$ octave
GNU Octave, version 2.1.71 (powerpc-apple-darwin8.1.0).

octave:1> plot (1:10)
octave:2> gnuplot: unable to open display ':0.0'
gnuplot: X11 aborted.
# X11 Application has to be opened
octave:2> plot (1:10)
# graph appears in X'Gnuplot' window.
octave:3> *******************************************



#!/bin/sh
# Copyright (C) 2007, Thomas Treichl and Paul Kienzle
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA

# Checks if Gnuplot is started from a file that is a link or if this
# file has been taken directly to startup the Gnuplot program.
LINK=`readlink "${0}"`
if [ -z "${LINK}" ]; then
  BASE="${0%/bin/gnuplot}"
else
  BASE="${LINK%/bin/gnuplot}"
fi
ROOT=`(cd "${BASE}" 2>/dev/null && pwd)`
# echo LINK: ${LINK}
# echo BASE: ${BASE}
# echo ROOT: ${ROOT}
# exit

# Setting up various path information variables that are needed to
# startup the Gnuplot program.
GNUPLOT_HOME="${ROOT}"
PATH="${ROOT}/bin:${PATH}"
DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}"
DYLD_FRAMEWORK_PATH="${ROOT}/lib:${DYLD_FRAMEWORK_PATH}"

# Export the variables that have been defined before so that the
# Gnuplot program gets knowledge about them.
export GNUPLOT_HOME PATH DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH

# Set up the path where gnuplot searches for the local .gnuplot file
# (HOME), gnuplot's help file is installed (GNUHELP) and the gnuplot
# prologue files are placed (GNUPLOT_PS_DIR)
if [ -z ${HOME} ]; then
  export HOME=`~`
fi
if [ -z ${GNUHELP} ]; then
  export GNUHELP="${ROOT}/share/gnuplot/4.2/gnuplot.gih"
fi
if [ -z ${GNUPLOT_PS_DIR} ]; then
  export GNUPLOT_PS_DIR="${ROOT}/share/gnuplot/4.2/PostScript"
fi
if [ "${GNUTERM}" == "x11" ]; then
  # Edit /etc/X11/xinit/xinitrc if you don't like it that an xterm is
  # opened if X11 is started.
  open "/Applications/Utilities/X11.app"
  if [ -z ${DISPLAY} ]; then export DISPLAY=:0.0; fi
  if [ -z ${GNUPLOT_DRIVER_DIR} ]; then
    export GNUPLOT_DRIVER_DIR="${ROOT}/libexec/gnuplot/4.2"
  fi
fi

# Invoke gnuplot, preserving spaces in all the input arguments.
"${ROOT}/bin/gnuplot-4.2.0" "$@"

reply via email to

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