Not to many people's surprise anymore, I'm both an engineer and a Mac user. While this would have been a serious anomaly a couple years ago, it seems more and more common these days, especially when working with other Unix/Linux machines. That aside, I had long been plotting all my data using the various functions in Matlab, and for the most part, I was very happy with the results (see here for reference). What I found, however, is that 3D scatter plots came out looking pretty terrible, and my start in molecular dynamics simulations required the scatter plots somewhat frequently.
So, there I was, looking lustfully at the gnuplot demos, so rich in their 3D visualization options. However, after downloading, extracting, and messing around in the terminal I found latest build (4.2.4) was having some issues with the makefile, even after configuration. I searched on the web for a while for some help which was fruitless until I stumbled upon this little nugget, which was a great relief, as I tend to be sort of lazy when sifting through readme's. To be honest, that entry alone has all the information you really need, but it assumes some basic awareness of a few things I hadn't heard about before, so I thought I'd post this information in a more outright manner.
UPDATE: Thanks to some feedback, I failed to note that you should install X11 and XCode before attempting to install MacPorts. X11 is available on your OS X install disc, and XCode is available (at no cost) on the Apple Developer webpage.
So, there I was, looking lustfully at the gnuplot demos, so rich in their 3D visualization options. However, after downloading, extracting, and messing around in the terminal I found latest build (4.2.4) was having some issues with the makefile, even after configuration. I searched on the web for a while for some help which was fruitless until I stumbled upon this little nugget, which was a great relief, as I tend to be sort of lazy when sifting through readme's. To be honest, that entry alone has all the information you really need, but it assumes some basic awareness of a few things I hadn't heard about before, so I thought I'd post this information in a more outright manner.
- MacPorts: Probably one of the coolest things ever, simple as hell, and quite powerful. MacPorts allows you to install a number of software packages by simply typing "install packagename" in the Terminal. Installation of MacPorts is a breeze once you download their disk image (.dmg) and run their installer (.mpkg), which you can get here.
- Once MacPorts has been installed, you'll need to start a new Terminal session. At that point, it's as easy as typing "sudo port install gnuplot" in the Terminal. I'll warn you, this installation can take a while (~30 minutes) as you download and install all the smaller software packages required.
UPDATE: Thanks to some feedback, I failed to note that you should install X11 and XCode before attempting to install MacPorts. X11 is available on your OS X install disc, and XCode is available (at no cost) on the Apple Developer webpage.
hello! I am running mac Os 10.5.6 and I foolowed your instructions and got the following error message:
ReplyDeleteError: Target org.macports.build returned: This port requires 'pbxbuild/xcodebuild', which couldn't be found (not MacOS X?)
How can I fix this?
This comment has been removed by the author.
ReplyDeleteAlright, upon further review... I would make sure you have both X11 and XCode installed. X11 is the xwindows environment for Mac OS X, and XCode is an integrated development environment freely available through apple.com. For reference check http://guide.macports.org/#installing.x11.
ReplyDeleteSir. I have done everything according to what you have described above, GNUPLOT has loaded successfully, yet when i give a plotting command (it executes it) but no additional window opens displaying a graph.
ReplyDeleteI am fairly new to gnuplotting on a mac.
Gnuplot on Mac OS X requires Aquaterm, did this come along with the Gnuplot install you ran? If not, you can get the Aquaterm package at sourceforge. Once installed, you can type "set term aqua" to use that within gnuplot. Hope this helps, it's actually be a while since I've done any serious plotting.
ReplyDeletethanks~
ReplyDeleteworks fine now.
Hello, I have followed your instructions but it is not working exactly. Gnuplot starts up and and it is automatically set to term aqua.
ReplyDeleteI have also installed x11 and xcode.
when i run a test of 'plot sin(x)', aquaterm boots up and then nothing happens... no graph pops up or anything. a new command line is not given either, giving me the impression that it is "stuck" trying to plot this graph.
i have just tried this:
ReplyDeleteset term x11
plot sin(x)
and it works... but it still doesn't work for aquaterm, which is what i'd prefer... any reasoning to this?
Wow! Thanks for this easy and step-by-step guide! This page was the fourth hit (somewhat appropriate given the site's moniker) on Google, and by far the most useful! Great post!
ReplyDeleteI have downloaded both applications but when I type in "sudo port install gnuplot" i receive the error "sudo: port: command not found"
ReplyDeleteAny idea what I am doing wrong?
Frankie@ Just read the very first post and along with the "Update" along with. You will have to install Macports, before
ReplyDeletethat one should install X11 (from the disc 1) and then XCode (free source).
If you need further help. Go to this page
http://guide.macports.org/#using.port.selfupdate
doodah@ Thank you!
@ Banana Grabber
ReplyDeleteI do also agree with you. With set term x11, it's working well. I have still but problem with aqua term. Any solution, mod?
I just want to thank you. You helped me a lot with this post!
ReplyDeleteAfters two hours of struggling I could easily install gnuplot and even if at the beginning I had the same problem of Banana Grabber now I'm able to get graphs.
Very useful page, not many are so clear and useful onthe web.
Keep it on!
I have never use Macports before.
ReplyDeleteI am trying to install gnuplot and aquaterm.
I recently bought a new Mac mini and OS X(snow leopard)and am familiar with some unix( not expert)
Great job!
This comment has been removed by the author.
ReplyDeleteI get the following error message: Error: db46 requires the Java for Mac OS X development headers.
ReplyDeleteError: Download the Java Developer Package from:
I've tried to download teh java developers package eithout any succes. What do i do?
Worked like a champ - thanks.
ReplyDeletethanks. went perfectly
ReplyDelete@Huguito, I got the same problem. Did you ever fix it? someone help!
ReplyDeleteThank you very much!! Your blog was by far the best explanation I found (and it has a cool name!!:) ) .
ReplyDeleteThis goes very smoothly (OS 10.6.3) with MacPorts installed.
Thanks again!
I agree, MacPorts is amazing...!
ReplyDelete