Gnuplot on Mac OSX
May 1, 2006: Replaced my binary by link to official distribution
Jan 27, 2006: Added a few more "Other" links
Jan 10, 2006: Added link to Mathew Peet tutorial
May 6, 2005: Added link to Danse team evaluations
Feb. 15, 2005: Received comments with links to Carbon version; added download link.
Nov. 4, 2004: Added a few more links to documentation and examples.
Oct. 4, 2004: Added note about the probable official OS X binary on the way.
July 16 8, 2004: v.1.1: Changed binary to Gnuplot Version 4.0 patchlevel 0; Removed Gnuplot source archive and added link to sources instead; Added description of v.4.
What is it?
Gnuplot is a widely used scientific plotting program from the unix world that is free and open source. It can produce most of the types of plots that a scientist might require on a dazzling array of output devices.
The Two Types
Self-contained
There are two main forms of Gnuplot available for the Mac. There is a self-contained Carbon binary that may be your only choice if you are running a classic (pre-OS X) Macintosh system. This also runs on (at least some versions of) OS X, and may be convenient if you just need to see the output of a Gnuplot command file, for instance, but don't need a permanent installation. This does not require X-Windows or any external viewer, and is easy to install, but it's not as good for external control (from gnuplot-py, etc.) as the standard Gnuplot. However, this version has some unique features:
gnuplot for Macintosh supports of number of Mac-specific technologies. In particular, gnuplot is AppleScriptable and recordable, supports PICT and QuickTime movie formats, incorporates a built-in gnuplot command file editor, and is drag-and-drop savvy. [....] it will run only on Mac OS 8.6 and above, must have Color Quickdraw, QuickTime, and CarbonLib 1.1 or above. The application has been tested under MacOS 9.0, MacOS 9.1, and MacOS X”
Download links for the carbon Gnuplot have a history of appearing and disappearing; with the help of visitors to this page I'll try to keep a pointer here to a working link from a trustworthy source. If I list a link here that means that at least I have downloaded the program from that location and verified that it seems to work (on an OS X system). At the moment you can get the self-contained Carbon gnuplot here.
Traditional
I recommend installing the traditional unix Gnuplot for serious use on OSX. Since OSX is a unix system, any unix program that was written to be reasonably portable can be compiled to run on it. This includes programs such as Gnuplot that, on traditional unix systems, produced graphical output with the X Window System, by installing a version of the X Window System on the Mac, such as the one that can be downloaded from Apple. However, some graphical unix programs can be made to work with OSX's native display system (Aqua); Gnuplot is one of these.
The official Gnuplot v. 4.0 sources compile without modification on OS X, and there is also a binary available here for PPC macintoshes. It works with X11 or AquaTerm, and in fact requires the latter to be installed. The readme document that comes with the binary download claims that it will not run unless X11 is also installed, but this is not true; fortunately you can run this gnuplot without needing to install X Windows.
I suggest you read up on the new features in v.4.0, a major upgrade. One significant enhancement is the incorporation of the pm3d splot mode, which has been an unofficial part of Gnuplot for some time. This lets you plot color-mapped surfaces.
You can get Aquaterm sources and binaries (which can be used with more than just Gnuplot), here.This has also undergone a major revision, so if you have a version < 1.0 you should upgrade.
Testing
This binary seems to work fine on OSX 10.3.4 (Panther) on a couple of different G3 and G4 systems. I am interested in other's experiences with this software on a variety of configurations, and in any other relevant information. Please email me with any notes you think might be useful to others, and I'll include your comments here (tell me if you prefer to be anonymous). Note that the both official binary and the one that you can build from source do not include all the terminals that may be available on other systems; I have no information about this, but would welcome comments from readers who either know why or know how to get support for other output devices, as I sometimes get email asking about this.
The new version of Aquaterm seems to be faster than previous ones, so I've been using this now for moderately large 3d plots, which I had been doing with x11. You do get some mouse control with the x11 terminal, however, that you do not get with Aquaterm: you can rotate 3d plots and, it seems, change the height of the z-axis with the mouse; you can zoom in on a selection in a 2d plot, although I wasn't able to figure out how to zoom out.
Other Links
MacResearch: A lot about doing science with OS X.
MacPython and Gnuplot in MacOS X
Patches from Ethan A Merritt: For fancy histograms and other nice things.
Gnuplot.py is a Python package that interfaces to gnuplot, the popular plotting program. It allows you to use gnuplot from within Python to plot arrays of data from memory, data files, or mathematical functions."
Danse evaluation: Review of several plotting packages by a team at the Danse project. Most of them have some kind of interface with the python scripting language.
Plotting data using Gnuplot: A little tutorial by Mathew Peet.
Some Fun with GNUPLOT: Interesting 3d surfaces (but not much about gnuplot per se).
Gnuplot Tips (not so FAQ): Very useful, well organized tutorial information in English and Japanese.
Ruby Gnuplot: "Ruby Gnuplot is a pipe-based interface to [...] gnuplot [...]. Through this interface almost every capability of gnuplot is useable from within Ruby." (Ruby is an increasingly popular scripting language.)
Comments