I just started auditing a Mathematical Models in Biology class and Matlab is one of the requirements. I had relatively good experience with the free, open source alternative,Octave back in college, but then I was running Linux, not OSX. It took me about an hour to figure out how to set it up (I was a little worried for a bit).
- Download the Octave binary for OSX from Octaveforge.
- Install Octave and Gnuplot (in the extras folder). I just dragged them to /Applications (X11 is required for Gnuplot—should be found on OSX install disk)
- Set the environment variable for gnuplot (Octave is supposed to do this automatically, but it didn’t for me):
sudo ln -s /Applications/GnuPlot.app/Contents/Resources/bin/gnuplot /usr/bin/gnuplot
(thanks for the help, Toby) - Download and install (again in /Applications) Aquaterm which will actually render the gnuplot graphs.
- Within Gnuplot, set the renderer: “terminal aqua”
- Try it out in Octave (I had to restart Octave and Gnuplot to get it all to work):
x = linspace(-pi, pi, 100);
y = sin(x);
plot(x, y);
Thank you: High Performance Computing for Mac OS X, the Octave Wiki and Google for helping me find what I needed.









Well, that was really
Well, that was really helpful.
I was searching for a gnuplot binary and hadn’t realized that octave provided one…
Thanks a lot!
Best,
Daniel
Hi, thanks that’s a good
Hi, thanks that’s a good explanation. I tried it but it only works when I log in as administrator. Typically I use a standard user account, and then I always get the error message “unable to open display ‘:0.0′ X11 aborted”. On the other hand, if I start X11 first, then plotting works, however, plots are shown directly in X11, not with AquaTerm. Do you have an idea what might be wrong and how it could be fixed?
Re: AquaTerm
Re: AquaTerm problem
Actually, gnuplot works fine with AquaTerm, the problem must be that octave doesn’t talk to gnuplot. For setting up the symbolic link I had to switch user accounts. It would only work from the admin account, and only with ’sudo’. Did you not have to do that?
PS: Octave Hi again, just
PS: Octave
Hi again, just wanted to let everybody know, that it must be a problem with my current user account. I finally remembered the typical test, i.e., create a clean new user account and see if that works. And it does. In other words, one does not have to be administrator. However, as mentioned above, to create the symbolic link mentioned in the post, the following command has to be entered from an admin account: “sudo ln -s /Applications/GnuPlot.app/Contents/Resources/bin/gnuplot /usr/bin/gnuplot”.
Thanks,
Toby
Awesome, thanks for the
Awesome, thanks for the feedback. I’ll update the script—you were right.
hi, I installed octave and
hi, I installed octave and gnuplot, and when I tried to plot sin(x), octave shows me the following error:
octave-3.0.1:2> plot(x,sin(x))
dyld: Library not loaded: /usr/X11R6/lib/libXpm.4.dylib
Referenced from: /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot-4.2.3
Reason: image not found
dyld: Library not loaded: /usr/X11R6/lib/libXpm.4.dylib
Referenced from: /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot-4.2.3
Reason: image not found
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 75: 3092 Trace/BPT trap GNUTERM=”${GNUTERM}” GNUPLOT_HOME=”${GNUPLOT_HOME}” PATH=”${PATH}” DYLD_LIBRARY_PATH=”${DYLD_LIBRARY_PATH}” HOME=”${HOME}” GNUHELP=”${GNUHELP}” DYLD_FRAMEWORK_PATH=”${DYLD_FRAMEWORK_PATH}” GNUPLOT_PS_DIR=”${GNUPLOT_PS_DIR}” DISPLAY=”${DISPLAY}” GNUPLOT_DRIVER_DIR=”${GNUPLOT_DRIVER_DIR}” “${ROOT}/bin/gnuplot-4.2.3″ “$@”
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 75: 3098 Trace/BPT trap GNUTERM=”${GNUTERM}” GNUPLOT_HOME=”${GNUPLOT_HOME}” PATH=”${PATH}” DYLD_LIBRARY_PATH=”${DYLD_LIBRARY_PATH}” HOME=”${HOME}” GNUHELP=”${GNUHELP}” DYLD_FRAMEWORK_PATH=”${DYLD_FRAMEWORK_PATH}” GNUPLOT_PS_DIR=”${GNUPLOT_PS_DIR}” DISPLAY=”${DISPLAY}” GNUPLOT_DRIVER_DIR=”${GNUPLOT_DRIVER_DIR}” “${ROOT}/bin/gnuplot-4.2.3″ “$@”
error: you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the ‘gnuplot_binary’ function
and I really don`t know what to do
If, someone could help me, I
If, someone could help me, I would be very gratefull!
thanks
Post new comment