Home > Mac OS X > Installing gnuplot in Mac OS X

Installing gnuplot in Mac OS X

The easiest way of installing gnuplot is using macports. Just Install macports and run “sudo port install gnuplot” , and this will install gnuplot along with all the dependencies. If you don’t want to install macports, then you can proceed with the following steps.

Before you download and install the gnuplot, you need to download Read Line lib for gnuplot. Perform the following to install read line lib:

  1. Download the latest read line lib source from here.
  2. Unzip the downloaded file, and copy the file to the location you want to install (i.e.  /user/your_acct/local).
  3. go to shlib subfolder, and open Makefile. Search -dynamic and change it to -dynamiclib. You may find an error saying: use dynamiclib instead of dynamic
  4. Go to the directory and run the following command.

./configure

make install

Now, you can install gnuplot. Perform the following steps:

  1. Download the latest gnuplot source packages from here.
  2. Unzip it, and go to that working directory.
  3. And, run the following for the installation

./configure

make install

That’s all. Now you can type, gnuplot and start using it 🙂

Special thanks to Bhou for your helpful post regarding gnuplot installation.

Advertisements
  1. Ilho
    April 15, 2013 at 4:31 pm

    Good Posting.

    3. go to shlib subfolder, < — could you explain it more? I cannot find the file "MakeFile". THanks.

    • April 15, 2013 at 6:22 pm

      Hi, Thanks. I just checked that there is a Makefile in Shlib folder. Download the Readline source from the aforementioned link, unzip it, and go to the shlib folder.

  2. Reefersleep
    April 30, 2013 at 3:30 pm

    Hello Safiqul

    I’ve been trying to follow your instructions here, but it is not going well for me. I am a command line newb and completely new to the configure and make commands as well as Makefile.
    What I’ve done so far:

    1. Download the latest read line lib source from here.
    2. Unzip the downloaded file, and copy the file to the location you want to install (i.e. /user/your_acct/local).

    I’ve done 1. and 2. and put readline-6.2 in /Applications/ .

    3. go to shlib subfolder, and open Makefile. Search -dynamic and change it to -dynamiclib. You may find an error saying: use dynamiclib instead of dynamic

    Did this, no problem 🙂

    4. Go to the directory and run the following command.
    ./configure
    ./make install

    Hm, I’ve attempted to do this, but it doesn’t quite work.
    I assume that by “the directory”, you mean /readline-6.2 .
    ./configure works here, but ./make install does not.

    Srens-MacBook-Pro:readline-6.2 Soeren$ ./make install
    -bash: ./make: No such file or directory

    make install does not quite work either.

    Srens-MacBook-Pro:readline-6.2 Soeren$ make install
    /bin/sh ./support/mkinstalldirs /usr/local/include \
    /usr/local/include/readline /usr/local/lib \
    /usr/local/share/info /usr/local/share/man/man3
    for f in readline.h chardefs.h keymaps.h history.h tilde.h rlstdc.h rlconf.h rltypedefs.h; do \
    /usr/bin/install -c -m 644 ./$f /usr/local/include/readline ; \
    done
    install: /usr/local/include/readline/readline.h: Permission denied
    install: /usr/local/include/readline/chardefs.h: Permission denied
    install: /usr/local/include/readline/keymaps.h: Permission denied
    install: /usr/local/include/readline/history.h: Permission denied
    install: /usr/local/include/readline/tilde.h: Permission denied
    install: /usr/local/include/readline/rlstdc.h: Permission denied
    install: /usr/local/include/readline/rlconf.h: Permission denied
    install: /usr/local/include/readline/rltypedefs.h: Permission denied
    make: *** [install-headers] Error 71

    In experimenting, I tried doing just
    make
    which did a whole bunch of stuff which I won’t paste here, but I don’t think it was a success – I’m not sure, though. If I do man readline, I get a working man page – does this mean that it is properly installed? When I try to read the Makefile in /shlib/, it says -dynamic rather than -dynamiclib , even though I checked that it was saved properly before attempting the commands.

    I’m a bit lost here, so I hope that you can help me 🙂 Thank you for posting the tutorial in the first place!

    • May 1, 2013 at 6:11 pm

      The easiest way of installing gnuplot is using macports. Just Install macports and run “sudo port install gnuplot” , and this will install gnuplot along with all the dependencies 🙂

      I followed the aforementioned steps to install gnuplot by installing readline before gnuplot. Based on your errors, it seems like you don’t have the permission to access those files. Try with “sudo make install”.

  3. Reefersleep
    May 2, 2013 at 11:18 pm

    Thanks a bunch, Safiqul – I used macports, and it worked like a charm! I’ll read up on Makefiles, though 😉 And make an effort of getting better at using Terminal 🙂

  4. June 19, 2013 at 10:51 pm

    HI, Safiqui. I’m the newb-est of them all, and tried to follow the latest suggestion — “sudo port install gnuplot.” So I downloaded MacPorts did the installation using the package installer. I then typed that (“sudo port install gnuplot”), hit return, then password as requested by Terminal, and got these error messages:

    Error:
    Error: No Xcode installation was found.
    Error: Please install Xcode and/or run xcode-select to specify its location.
    Error:
    Warning: xcodebuild exists but failed to execute
    Warning: Xcode does not appear to be installed; most ports will likely fail to build.
    —> Computing dependencies for gnuplotError: Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?
    Julios-MacBook-Pro:~ juliohuato$

    I’m using a MacBook Pro with a Mac OS X Lion 10.7.5 (11G63).

    What am I doing wrong?

    Thanks a million in advance!

    • June 19, 2013 at 11:02 pm

      errors indicate that you need xcode. Install xcode from the appstore, it’s free 🙂

  5. June 20, 2013 at 12:49 am

    Thanks, but I’m still falling way short. New error message:

    Warning: The Command Line Tools for Xcode don’t appear to be installed; most ports will likely fail to build.
    Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
    —> Computing dependencies for gnuplotError: Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?

    • June 20, 2013 at 8:36 am

      Ah i see.. To install command line tools -> open xcode, then go to preference and then click the download tab. And, then install command line tools.

  6. B-rage
    July 3, 2013 at 1:19 pm

    Hi, ive gotten through most of it, and installed the macports, however when i type “sudo port install gnuplot” into the terminal and procede to enter my passwor i get the error message:
    sudo: port: command not found.
    The same error message comes up when i type in “sudo port -v selfupdate” instructed on the macports website.
    Idk what im doing wrong, so any help would be appreciated.

    • July 3, 2013 at 1:36 pm

      Hi,

      Add this to your home profile (i.e $yourhomedirectory/.profile):

      export PATH=$PATH:/opt/local/bin

      Use this to update the environment:

      source .profile
      and then : sudo port -v selfupdate

      Hope this will help 🙂

      • July 3, 2013 at 1:38 pm

        It did, thank you!

      • B-rage
        July 3, 2013 at 1:42 pm

        Cheers! That worked great!
        The installer for gnuplot is running now 😀

      • July 3, 2013 at 1:49 pm

        Awesome, hope you will enjoy plotting with it 🙂 😀

  7. Luis
    August 10, 2013 at 5:17 am

    Hi there, I am extremely new to LaTex and gnuplot and i’m trying to download gnuplot to try it out.
    Firstly I downloaded marports and then ran the command line “sudo port install gnuplot” as instructed. Then I had the issue huatojulio had and fixed it by downloading the file in xCode as instructed. Then I ran the command line again in terminal “sudo port install gnuplot” and it appeared to be installing the everything and took a while doing so. When it was complete, in Applications I now had a something called AqueTerm which I thought would start gnuplot, I clicked on it and nothing happened… So I thought I must be missing this software called AquaPort so I searched and downloaded this:
    http://sourceforge.net/projects/aquaterm/

    After installation nothing happens, I click on AquaTerm an still nothing happens. I have tried uninstalling everything (as far as I know), to reinstall thinking AquaTerm must be installed before the steps you instructed… but I get AquaTerm with nothing happening and when I try to run the command line “sudo port install gnuplot” I get this message in terminal:

    “—> Computing dependencies for gnuplot
    —> Cleaning gnuplot
    —> Scanning binaries for linking errors: 0.2%
    Warning: Error parsing file /Applications/MacPorts/AquaTerm.app/Contents/MacOS/AquaTerm: Error opening or reading file
    —> Scanning binaries for linking errors: 100.0%
    —> No broken files found.

    Basically I don’t know whats going on and how to I make gnuplot install properly. Could you please help me?
    Thanks for your attention.

    • August 16, 2013 at 1:25 pm

      Hi, so sorry for the late response. I’m not sure, this command should install all the dependencies along with aqua term. Try uninstalling aqua term,
      and run the command again. Or, follow the second procedure for installing gnuplot.

  8. Arturo Villegas
    August 18, 2013 at 6:48 pm

    I’m stocked on step 3 “go to shlib subfolder, and open Makefile. Search -dynamic and change it to -dynamiclib. You may find an error saying: use dynamiclib instead of dynamic” I click on the shlib folder and ther’s only one file, “Makefile.in” but I cannot open it, also I put the command ./configure make install in the terminal, located in the folder where I put the realdline, and it says ./configure: No such file or directory
    What should I do ?

    • August 18, 2013 at 10:03 pm

      Install macports and then run “sudo port install gnu plot”. This will install everything. Easy !!

      However, if you don’t want to install macports, then Just go into the subfolder shlib in the ReadLine folder and edit Makefile, search -dynamic and replace it with -dynamiclib

      and then type:

      make clean
      make install

  9. Dipu
    August 20, 2013 at 12:57 pm

    It is showing me this error. Where is the problem
    “warning: Skipping unreadable file “abcd.txt”
    No data in plot”

    • August 20, 2013 at 7:50 pm

      Your abcd.txt file contains unreadable characters !

      • Dipu
        August 22, 2013 at 5:59 pm

        But I wrote everything ok

      • August 22, 2013 at 9:54 pm

        What’s in your file?

  10. Solal
    October 18, 2013 at 1:49 pm

    Hey,

    Thanks for the tutorial. When I open the Makefile, I can’t find -dynamic. I’ve checked with vim and text edit just to make sure.

    • October 18, 2013 at 2:23 pm

      I strongly recommend that you install macports, and then run “sudo port install gnuplot”. This will install everything. Easy !!

  11. November 4, 2013 at 8:43 pm

    Hello
    my english is not good,sorry,
    I have install gnuplot by first homebrew then type command “brew install gnuplot”. And the gnuplot installed.
    However, gnuplot not worked, when i retape again “brew install gnuplot” I got :
    Warning: A newer Command Line Tools release is available
    Update them from Software Update in the App Store.
    Warning: gnuplot-4.6.3 already installed, it’s just not linked

    • November 4, 2013 at 10:40 pm

      never used brew. Try to grab the newer Command Line Tools.

      • November 5, 2013 at 6:47 am

        it worked great! Thanks.

  12. Claudio
    June 23, 2014 at 10:06 am

    The installation was made properly, but when I open gnuplot and digit, for example, plot sin(x), it doesn’t show anything on screen… Why…?

    • June 23, 2014 at 10:20 am

      It works for me. Could you please check the “terminal type set” ? Try to install aquaterm..

  13. Petie
    January 12, 2015 at 5:26 pm

    Thank you for your hint to install macports. The install worked perfectly.

  14. Akshi
    April 12, 2015 at 8:22 pm

    I want a png output, and the set terminal command is not taking jpg, png or anything like that. also in the begining its showing terminal “unknown”
    I have installed Xcode.
    I don’t know what to do.

  1. October 20, 2015 at 1:11 am

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: