gnuplot with AquaTerm on OSX Snow Leopard

The gnuplot graphing utility has always had excellent support for multiple terminal types. While the X11 terminal is a satisfactory GUI view for the graphs, I prefer to use the AquaTerm terminal on OSX as it is more ‘Mac-like’ and feels more natural.

Also, I do prefer to compile gnuplot by myself on OSX rather than downloading the pre-packaged binaries – as this gives me more control over the compilation (including getting around the stupid Apple readline bug – where Apple has essentially shipped a broken readline by using libedit to emulate the non-existent libreadline).

This local compile requires that AquaTerm be installed so that the library dependencies for aquaterm exists in:


and the corresponding headers are available at:

In addition, the itself resides in /Applications.

However, on OS X Snow Leopard, there is a catch – the version of AquaTerm is 32 bit, whereas the default compilation of gnuport results in a 64-bit version – which is not able to load the 32-bit libaquaterm dynamic libraries.


In such a case, the gnuplot compilation does succeed – however, the default terminal becomes the X11 version – which is back to square-one.

A darwinports port does exist for gnuplot – however, as mentioned in an earlier post, this port seems to depend on half of the port repository (i.e., a ton of stuff you do NOT want gets installed as well).

However, there is a easier way to get around this situation. Here’s how.

  1. First install the default binary for AquaTerm from SourceForge and install normally. This step is to basically setup the right folders and symlinks so that you do not have to muck with these later
  2. Now install AquaTerm again from Darwinports – this port has the correct patches needed – and more importantly – builds a 64 bit version by default. This will also install the application under /Applications/MacPorts/


  1. Now comes the fun part. We will replace two folders from the darwinports version to the previously installed AquaTerm.
    • Step 1: Replace /Library/Frameworks/AquaTerm.framework with /opt/local/Library/Frameworks/AquaTerm.framework. This will ensure that the correct 64 bit AquaTerm libraries get referenced by the gnuplot compilation
    • Step 2: Replace /Applications/ with /Applications/MacPorts/ This will ensure that the correct 64-bit AquaTerm binary is in the correct location
    • Step 3 (Optional): You can now uninstall the darwinports version by running sudo port uninstall aquaterm from a terminal window
  2. Download the source code for gnuplot and extract the same.
  3. Run ./configure (using a command line parameter to ignore the broken Apple readline) and then make and make install (install will happen in /usr/local)


That’s it! The compilation should now succeed and gnuplot will be linked with the correct 64-bit aquaterm dynamic library. Enjoy!



20 Comments on “gnuplot with AquaTerm on OSX Snow Leopard”

  1. Soeren says:

    Or you could just use homebrew, add a remote for this and pull the newbrew branch and then do brew install aquaterm && brew install gnuplot.

    Darwinports is altogether too messy in my opinion.

  2. Chris says:

    Thanks heaps! That was really helpful; I had spent 2 hrs trying to google for alternative work-arounds.

    Cheers, Christian

  3. Mike says:

    Thanks very much, it works!

  4. Christophe says:

    Thank you very much. It helped me a lot!

  5. […] term显示效果很一般,所以还是要用AquaTerm。这样就需要有64位的AquaTerm,通过MacPorts可以做到。 所以在安装gnuplot之前,先安装64位的AquaTerm,到MacPorts网站下载Snow […]

  6. […] 其实还是很简单,gnuplot官网有manual, 在terminal用cvs命令获取源码包 cvs login cvs -z3 co -P gnuplot 然后进入gnuplot文件夹直接编译安装 ./prepare ./configure –with-readline=bsd –x-include=/usr/include/X11 –x-libraries=/usr/X11/lib make && sudo make instal 这样就可以使用gnuplot了,不过因为这样编译的是64位gnuplot,是无法使用AquaTerm来显示图片的。默认的X11 term显示效果很一般,所以还是要用AquaTerm。通过MacPorts可以安装64位的AquaTerm。下面是安装步骤: […]

  7. Michelle says:

    Thank you so much – this worked for me, and now I can get on with the math.

  8. Nicho says:

    Thanks for this nice guide. I just wanted to add that i got gnuplot 4.5 working with the 64 bit aquaterm from fink. suing the steps from this guide:

    Install 64bit fink
    install aquaterm (from sourceforge)
    compile and install 64bit aquaterm from fink

    replace the framework and app files with the files from fink (I did use links as i then can uninstall using fink)

    compile and install gnuplot

    I think the installation of the 32bit aquaterm can be skipped, for just copying the 64bit files to the right folders.


  9. KW says:

    Thank you!

    I installed gnuplot via Macports before following the steps above. Now I have no more problems plotting Graphs with gnuplot and displaying them in Aquaterm.

  10. […] gnuplot with AquaTerm on OSX Snow Leopard January 20108 comments and 1 Like on, 3 […]

  11. DW says:

    Thanks a lot! That was really helpful, been hours try to figure out this one!

  12. On Snow Leopard 10.6.7 using MacPorts I had to do this:
    sudo port install gnuplot
    Install AquaTerm from

    Now in terminal:
    gnuplot -e “plot sin(x)”
    opened the graph in AquaTerm

    At least someone else had been having the same problem:

    The proper solution would be to fix this issue in MacPorts…

  13. […] to install gnuplot including its AquaTerm terminal via homebrew (see Soeren’s comment on But the build for AquaTerm failed 😦 : 1 2 3cd /usr/local/Library/Formula/ wget […]

  14. Mark Lim says:

    Hi ,
    Can you help out?
    My objective is to compile and install gnuplot using Aquaterm on OS X Snow leopard. 10.6.8. Gnuplot 4.4.3 source.

    1. I had tried to configure with builtin readline….seems ok

    2. Make command seem to give me errors
    ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
    ld: warning: in /usr/lib/libwx_macud-2.8.dylib, missing required architecture x86_64 in file
    Undefined symbols:
    “wxFrame::DoGetClientSize(int*, int*) const”, referenced from:
    vtable for wxtFramein wxt_gui.o
    “wxApp::GetClassInfo() const”, referenced from:
    vtable for wxtAppin wxt_gui.o
    “wxWindow::MacGetLeftBorderSize() const”, referenced from:
    vtable for wxtPanelin wxt_gui.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make[3]: *** [gnuplot] Error 1
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    lims-mac-mini:gnuplot-4.4.3 lim$ pwd
    lims-mac-mini:gnuplot-4.4.3 lim$ ls

  15. Dan says:

    Thank you so much for posting this up. Years later, people are still running into this issue. Your fix worked like a charm.

    All the best,


  16. Christian M. says:

    Thank you so much. I have spent many hours over the past two weeks working on this silly problem. I have a new Mac Book Pro with Mountain Lion and was not able to get Octave to plot anything, even though gnuplot was more than happy to work with the X11 through XQuartz. I tried the DMG installs of Octave, GnuPlot, and Aquaterm, which all worked separately, but not together. Ditto for MacPorts and Homebrew. Then I went through several web pages of “fixes”. Again, no success. But at last with these instructions – I have plots with Octave!

  17. JRG Pulido says:

    try installing aquaterm first
    then gnuplot

    I use it via octave and works well on Lion

  18. bamboo says:

    After hours to try to get working I finally got it !

    Thank you so much !

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s