Gnuplot Download Mac

  1. Gnuplot Download Mac Download
  2. Gnuplot Download Mac Os X
  3. Gnuplot Download Mac Free
  4. Gnuplot Download Mac Download

Gnuplot for Mac. It is basically the graphing software, which works on Mac operating system. Graphmatica is yet another software for Mac OS. It helps in visualizing the mathematical calculations and analyzing the data for the researchers and students interactively. Download gnuplot for free. A portable, multi-platform, command-line driven graphing utility. A famous scientific plotting package, features include 2D and 3D plotting, a huge number of output formats, interactive input or script-driven options, and a large set of scripted examples. Gnuplot for Windows. Gnuplot is a portable command-line driven graphing utility for Windows, Linux, OS/2, OSX, VMS, and many other platforms. Gnuplot is able to generate both 2D and 3D plots; delivering the results in animated views. You can also save the graphs to a variety of image formats, including PNG, SVG, JPEG and EPS.

Remarks

This section provides an overview of what gnuplot is, and why a developer might want to use it.

It should also mention any large subjects within gnuplot, and link out to the related topics. Since the Documentation for gnuplot is new, you may need to create initial versions of those related topics.

Versions

VersionLast patchlevelLast Release Date
5.0.x5.0.52016-10-09
4.6.x4.6.72015-04-28
4.4.x4.4.42011-11-13
4.2.x4.2.62007-07-01
4.0.x4.0.02004-04-01

Basic introduction to programming language's rules

From the gnuplot 5.0 official online documentation:

The command language of gnuplot is case sensitive, i.e. commands and function names written in lowercase are not the same as those written in capitals. All command names may be abbreviated as long as the abbreviation is not ambiguous. Any number of commands may appear on a line, separated by semicolons ; . (T. Williams, C. Kelley - gnuplot 5.0, An Interactive Plotting Program)

Some examples of these basic rules are

1. A case sensitive language

Typing lowercase-defined commands in uppercase will generate an invalid command warning.

Also the N variable will be different from the n one.

2. Abbreviations

You can find an almost complete list of abbreviations here. Anyway the first three letters of any command in gnuplot work always as abbreviations. Some commands allows also a more powerful contraction. A little example is given below.

where p stands for plot , rep for replot and q for quit .

3. Separators

The symbol used to separate commands on a singe line is ;

set title 'My First Plot'; plot 'data'; print 'all done!'

5. Comments

Comments are supported as follows: a # may appear in most places in a line and gnuplot will ignore the rest of the line. It will not have this effect inside quotes, inside numbers (including complex numbers), inside command substitutions, etc. In short, it works anywhere it makes sense to work. (Ibidem)

Just remember the simple 'anywhere it makes sense to work' rule.

4. Extending commands

Commands may extend over several input lines by ending each line but the last with a backslash ( ). The backslash must be the last character on each line. The effect is as if the backslash and newline were not there. That is, no white space is implied, nor is a comment terminated. Therefore, commenting out a continued line comments out the entire command. (Ibidem)

For example, to split plot command on multiple lines,

will plot the same as

A little note on 'commenting out a continued line comments out the entire command'. If you type the command

an error will occur:

So it's better to be careful and respect the rule 'anywhere it makes sense to work' while using # comments.

Installation or Setup

Gnuplot is a portable command-line driven graphing utility. This example will show how to setup gnuplot in the various platforms.

Windows

  1. Download the latest version of the installer from gnuplot site.

  2. Run the downloaded file and allow it to run as administrator if requested

  3. On the setup window select the language and follow the instructions on screen.

  4. (optional) During the installation you may select the gnuplot to be added to the PATH that will allow you to run commands from anywhere on the command line. If you choose not to do so you may add it manually later or cd to the gnuplot installed directory prior to running commands.

The default installation location of gnuplot on Windows is C:Program Files (x86)gnuplot

Gnuplot Download Mac

NOTE: the filename will be of the format: gp<version>-win32-mingw.exe

Linux

The installation on Linux can be done through the different package managers as follows.

Arch

Debian and Ubuntu

CentOS / RedHat

Fedora

Mac OSX

Using Homebrew

Using MacPorts

Test the installation

After installing gnuplot it's a good idea to run a simple example to ensure all is working fine.

  1. Open your terminal
  2. Type gnuplot .
  3. Your prompt should now change to gnuplot>
  4. Type: plot sin(x)

If all is well you should see now a sin(x) graphic generated by gnuplot.

Note: if you are on Windows and have not added gnuplot to your PATH you' ll need to navigate to the <gnuplot_install_path>bin folder. The default location is: C:Program Files (x86)gnuplotbin



Hardly anyone has gone through a college mathematics or physics course without meeting the wonderful gnuplot. However, it turns out that installing gnuplot (or Octave, for that matter — but let us leave that for another day) on a Mac is a pain in the neck. At a time when installing games take a two clicks, it simply is not straightforward to install gnuplot.

After scratching my head over it for two days straight, I finally installed gcc, gnuplot, Octave and LaTeX on my new Mac (OS X 10.10.3, Yosemite) and decided to note some points/instructions down here for anyone else looking for a simple solution from start to finish contained in one place.

Gnuplot Download Mac Download

Update, 6 December 2019 Since this article was written about five years ago Homebrew has changed its gnuplot installation system and does not allow picking terminals. This makes this a little inconvenient, not to mention useless. Thankfully MacPorts still supports a robust full gnuplot installation which makes me change my recommendation from ‘always install Homebrew’ to ‘always install both Homebrew and MacPorts’. Install MacPorts by picking a suitable package on their installation page. Then proceed as follows:

  1. Check what terminals are available (optional) with sudo port variant gnuplot
  2. Install gnuplot with required terminals e.g. sudo port install gnuplot +qt5 + x11 +aquaterm +wxwidgets will install gnuplot with QT5, x11, AquaTerm and WXT.

Click here to skip older updates and go to the main (legacy) article which runs you through XCode, GCC etc. Specifically, the above two steps replace steps 7 and 8 in the main article below.

Update, 9 August 2017 Since this article was written about two years ago a new version of gnuplot has been released, as have two new versions of macOS. A couple of my views have also changed as a result of this: I think AquaTerm is good enough for gnuplot and the decision to use X11 should only be a matter of specific needs or taste.

This article has turned out to be more popular than I hoped, with several universities and academic institutions sending lots of traffic towards it, all the way from these interesting lecture notes from Stony Brook University, NY, to this Chinese (I think) forum. In view of public demand, below is a small update.

If all you are interested in doing is to install gnuplot save yourself the trouble of scrolling down and follow these instructions (tested on macOS High Sierra) to install both AquaTerm and X11, omitting commands as necessary if you only wish to use one and not the other.

  1. Install homebrew via the Terminal with /usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'

  2. Install xquartz if you want X11 brew cask install xquartz

  3. Install aqua if you want AquaTerm brew install Caskroom/cask/aquaterm

  4. Install gnuplot (remove the --with-name for terminals you do not need brew install gnuplot --with-aquaterm --with-qt4 --with-x11

That is all. Enjoy plotting with gnuplot.

If you have been trying to dodge your way out of Apple’s enormous 2.6GB Xcode app, get ready to face the demon: almost nothing related to coding will work on your Mac without Xcode and its libraries, so head to the App store and download Xcode.

Download command line tools for Xcode. You can do this via the Terminal.app (Applications → Utilities → Terminal) with the following command (which you may copy and paste):xcode-select --install

This gives you a message saying command line tools have not been installed and will offer to install them for you now; proceed and install them. It should take some time, though not as much as downloading Xcode.

You need to have accepted the Xcode licence agreements to use many related programmes, so open Terminal and type in the following (you can copy and paste it as usual):

Gnuplot Download Mac Os X

Download

sudo xcodebuild

This gives you a message requiring you to press return/enter to view the license. Hit enter, read through it and type in agree at the end when prompted. Type in cancel to disagree, meaning you should probably have been reading some other article now, not this. In any case, once you read and agree, proceed to the next step.

Gnuplot Download Mac Free

GCC should work straight after installing Xcode. Open Terminal and do the following:

vi Hello.c

In the page that opens, copy and paste these lines:

Then press Esc and type :wq and you will return to the first Terminal screen. There, type the following two lines (press Return after each line):

gcc Hello.c -o Hello

Mac

./Hello

You should get an output on screen saying ‘Hello, world.’ if all is well. And that is all for GCC, which is actually simple, unlike gnuplot and Octave.

MacTeX is LaTeX for Mac. For basic — and mostly all general purposes — I did not see the need to install the entire MacTeX package, which is 2.5GB in size. As an alternative, I opted for the smaller, yet feature-rich, BasicTeX package which I usually install on all my systems.

You can go with the full package or opt for the smaller one as per your needs. Both files are .pkg and involve the usual GUI installation so this step should be no problem for anyone.

XQuartz, or colloquially the X11.app, is a Mac version of Windows' X Server. It is necessary for Homebrew, which we will install next, as well as to use the (somewhat) standard xterm display in gnuplot. Download XQuartz, which comes as a disk image which you can easily mount and install via a package.

The catch here is that the installed X11.app (check Applications → Utilities → X11 after installing) must be started before the Terminal is fired up to run gnuplot. That is the only way to make gnuplot start with the x11 terminal by default. If you find gnuplot aborting, you have probably not started x11.

Since Macs do not come with a package manager built-in like Linux, you will have to opt for alternatives often developed by the community. While MacPorts has been a popular one, I have found it buggy, especially so with xterm (x11) display for gnuplot, which is both the standard and more convenient than Aqua, the default for Mac — do not ask me why.

Installing Homebrew, an increasingly more preferred MacPorts alternative for good reasons, is simple. Open Terminal and use the command given below:

ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'

This should install Homebrew without a problem. Homebrew commands begin with brew and are fairly easy to follow.

Installing gnuplot once you have come this far, thankfully, is fairly simple:

brew install gnuplot --with-x11

Remember to specify --with-x11 instead of the older (now deprecated) --x11 or brew install gnuplot without x11.

Now it is time to check gnuplot. Fire up gnuplot:

gnuplot

Then type in a simple plotting command and hit return/enter.

Gnuplot Download Mac Download

plot sin(x)

This should immediately display a generic sine graph (not saved permanently anywhere, of course) on your screen.

How to save and use plots is beyond the scope of this article, but for now, if you find the output graph giving out an error, make sure you have the x11.app running before you open Terminal.

Hat tip to Michael Budd After writing this article, I came across Michael Budd’s on installing gnuplot straight from the source files. I tried in vain to get x11 to work well after installing in this method, but perhaps I was not good enough in trying. That said, if you are not particular about x11, this is a really quick method to get gnuplot to work.

Note that when trying the third make install command, it failed on my system several times, so I had to work around that using sudo make install and entering my administrator password. If you do not have, administrator rights Mr Budd’s method may not work.

Some machines may still have problems with gnuplot, in which case you could try editing your bash profile. Please try this at your own risk, and if you have no idea what this does, I strongly insist that you do not do it. In any case, I cannot be held responsible for whatever happens to your system.

touch ~/.bash_profile; open ~/.bash_profile

Enter the above command in your Terminal to open your .bash_profile for editing in TextEdit (or whatever else is your default editor). Next, in the open file, type the following and hit +S to save it, then close it.

if [ -z ${DISPLAY} ] then export DISPLAY=:0.0 fi

Restart Terminal and it should work fine now. This has something to do with gnuplot sending data to the wrong display. You can find more details and a fair bit of discussion on this around the web.

That should be all. You should have a working copy of gnuplot on your machine now. Have fun with it: it supports eps export as well as links to c programmes via the pfile command. So far, in my use, I have not come across any problems after installing it this way, but if you do, let me know and I will try to help you as best as I can.