help-octave
[Top][All Lists]
Advanced

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

Re: MAC and GNU Plot - Help Please


From: Stuart Edwards
Subject: Re: MAC and GNU Plot - Help Please
Date: Sun, 25 Sep 2011 10:50:53 -0400

I guess I should have read all my mail before responding to your earlier post .......... sorry about that.


On Sep 25, 2011, at 9:24 AM, Wesley Davis wrote:

I spoke too soon.  Now I can plot at the Octave command line.  
 when you do this at the command line
 
> octave -q
>sombrero(25)

you should get a nice colored hat in an AquaTerm window - this means all three apps are installed and working correctly

The new problem is all of my Octave .m scripts that plot my data will not run.
what were you running them on previously?  
 When I click to edit my Octave scripts,  I get the Xcode window and my scripts are not running.
that's to be expected .... by clicking on the file you are just opening it for editing - but the script will not be running.  Do you really mean '...click to edit....' because it seems that that is what you got.  If you want to run the script, that's a different process.

 Any way around this?  
You should run the script from the command line.  There's probably a number of different ways to do this, but for me the following works

SEsMacPro:~ stu$ ./octave/mfiles/hashbangtest/hashbangtest2.m
a =

   1   2   3

Here I tell the script hashbangtest2.m to run by prefixing ./ to the file path.  Note that this is from the bash command line - not from within octave.

Note that the file is called hashbangtest2 - that's because it took me a long time to figure out how to write a hashbang line that would work (that's the first line of the script that tells bash where to look for something that can execute the command).  In this script, the hashbang line is:

#!/usr/bin/env /Applications/Octave.app/Contents/Resources/bin/octave -qf

I'm not sure what it should be for a MacPorts installation ..... back to the /opt/* problem - maybe someone else can chime in.

Alternatively, if I cd to the directory where the script is located and open octave and then do

octave-3.4.0:1> hashbangtest2
a =

   1   2   3

I get the same result, but note that the .m on the filename is not needed.  This is generally the mode I work in when developing or modifying scripts 

This all assumes that the script is executable - which you can set with chmod once you have created it.

Good luck

Stu



Macports required that I install Xcode before installing Macports.  Help


Wes
On Sun, Sep 25, 2011 at 8:49 AM, Wesley Davis <address@hidden> wrote:
Stu,

Your procedure worked well,  after uninstalling Aquaterm, gnuplot and octave,  and re-installing them in the precise order recommended.   My plots come up very nicely at the octave prompt!  Thanks.

I also tried your procedure before uninstalling and re-installing Aquatem, Gnuplot and Octave, and I was not able to plot at the Octave prompt.  

Just one comment.  After I executed the following command:

cd /usr/local/lib
sudo ln -s libaquaterm.1.0.1.dylib libaquaterm.1.0.0.dylib "

I got a ">"  at the command line, that I could not quit or exit out of.  So, I killed the Xterm and and gave things a whirl anyway.  I got the  results I needed, a working Gnuplot at the Octave prompt. Not sure the purpose of ">" or the second step listed above.


Thanks,


Wes




On Sat, Sep 24, 2011 at 11:10 AM, Stuart Edwards <address@hidden> wrote:
It's been a while since I tackled this ... back in 10.4 days, In 2006 Jo Sarens published some instructions that were very helpful.  I think they are probably still relevant.

" To ensure that everything gets set up correctly, install AquaTerm first, Gnuplot second and Octave last.  For AquaTerm and Gnuplot all  you need to do is run their respective installers and everything will be set up correctly.  Installing Octave, however is a little bit less intuitive [ Note, this is probably not true now with binary installers that are available so I'll skip the rest of this section]

Okay,now that everything is installed, it's time to get started on doing some serious science, right?  Not so fast ......

First off, there are environmental variables that need to be set correctly.   At the command line:

cd ~
touch .bashrc
open .bashrc

The second line creates .bashrc if it doesn't already exist.  An editor should pop up. Put the following into it, save and quit:

export PATH=$PATH:/usr/local/bin
export GNUTERMAPP=/Applications/AquaTerm.app
export GNUTERM=aqua

To make bash aware of these new settings, you must make it re-read the .bashrc file.  An easy way of doing that is running the following command:

source .bashrc

With that take care of, there is only one more thing we need to do.  If you were to run Octave now and tried to  make it plot something, you'd get an error message saying it can't find libaquaterm.1.0.0.dylib.  The reasonit can't find this library, is that you've got a newer version, namely libaquaterm.1.0.1.dylib (at the time of writing).  To fix this , create a link like so:

cd /usr/local/lib
sudo ln -s libaquaterm.1.0.1.dylib libaquaterm.1.0.0.dylib "

[Note - I would try to plot before setting this link - it may not be necessary on later versions .....]

Test the installation with this at the command line:

sombrero(25)

An AquaTerm window should open and display the test result

Good luck

Stu

On Sep 23, 2011, at 7:06 PM, Wesley Davis wrote:

> Hello,
>
> I have been trying to plot images from some of my Octave programs on my MAC without success.  I have downloaded Aquaterm and  GNU Plot.  However,  I am not sure what goes where.   What do I need to do to plot my graphs while at the Octave command line?
>
>
> Wes
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave





reply via email to

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