First you need to test if gnuplot works. I compiled the source but you can work with a fink or macport version; Now you can test gnuplot in the terminal $ gnuplot;; Then gnuplot must be find in the path.A simple solution is to create a link for example in /usr/local/bin/ through the real file gnuplot but if you know how do you can modifify your path directly (to test the path in the terminal. Mac OS X El Capitan 10.11.1 dmg for mac free. download full version. Jun 23, 2017 2 thoughts on “ Install gnuplot on Mac OSX ” Charlie Dickman says: August 26, 2017 at 10:03 pm You should indicate that all 3 lines in step 3 are a single command. A command-driven interactive function plotting program. Port Health: 11x8664 11arm64 10.15 10.14 10.13 10.12 10.11 10.10 10.9 10.8 10.7. Binary versions of Gnuplot for OS X/macOS. These are primarily intended for users who normally work on Linux and wish to replicate their tools on a Macintosh.
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
Version | Last patchlevel | Last Release Date |
---|---|---|
5.0.x | 5.0.5 | 2016-10-09 |
4.6.x | 4.6.7 | 2015-04-28 |
4.4.x | 4.4.4 | 2011-11-13 |
4.2.x | 4.2.6 | 2007-07-01 |
4.0.x | 4.0.0 | 2004-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
Download the latest version of the installer from gnuplot site.
Run the downloaded file and allow it to run as administrator if requested
On the setup window select the language and follow the instructions on screen.
(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
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
Gnuplot Macro
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.
- Open your terminal
- Type
gnuplot
. - Your prompt should now change to
gnuplot>
- 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
This page describes how to get SciPy and Gnuplot working underMacOS X 10.3 (Panther). It is a small modification of instructions provided by Chris Fonnesbeck. If you have questions orcomments about my attempt here pleasecontact me.
Users of older versions of MacOS X may at least be able to getNumerical Python and Gnuplot working using these alternate instructions.
Another alternative is to use Unix versions of Python and otherprograms. This is easy using theFink project.This approach requires extensive downloads. However, it makes the entireworld of open-source Unix software available to you, so it may wellbe worth the download time. On the other other hand, MacPython isis a very elegant Mac-centric program.
The following instructions use the terminalapplication, which is located in /Applications/Utilities. You may alsoneed to have enabled the root account (start/Applications/Utilities/Netinfo Manager, then selectSecurity->Enable Root User).
MacPython Add-ons
MacPython 2.3 is included as part of MacOS 10.3 (Panther). However,the installation is missing some very useful features. They are providedby the MacPython 2.3 add-ons package, which can be obtained here.This adds PythonIDE (an excellent interactive development environment) anda Package Manager which lets you add Python extras to the MacPythoninstallation. Once installed, try PythonIDE (in /Applications/MacPython).
Numerical Python
You may need to change some file ownerships before installing NumericalPython. In a terminal window type the command(all one line regardless of how it appears in your browser).Here USERNAME is your user name. Alternatively you can do thisin the Finder by navigating to the above (starting with your hard driveicon), control-clicking to 'Get Info' and changing ownership.
Open the MacPython folder in your Applications folderand start PackageManager. Select Numeric-22.0-source, uncheck the box'For current user only,' check 'Install dependencies,'and click Install. (Among other things thisshould install a directory Numeric within the directorywhose ownership you changed above.) You may need to do this twice;if so, choose 'Overwrite.'
Xcode Tools
Apple's developer tools (aka Xcode Tools) may have been installed withyour operating system. If typing 'which gcc' in a terminal windowproduces '/usr/bin/gcc' then the tools are probably installed.The remainder of this installation worked for me using Xcode Tools 1.5;you may want to get this version if yours is older. The package isfreely available at the AppleDeveloper Connection. You need to join ADC, but joining is free.Select all optional packages when installing (by choosing customize).
g77
A Fortran compiler g77 is available fromGuarav Khanna's High Performance Computing for Mac OSX site. Download the Panther binary (version 3.4). Thenin a terminal window cd to the download directory andtype:
This installs everything in /usr/local.
FFTW Libraries
FFTW is a C subroutine library for performing fast Fourier transformations. Download version 2.1.5. In a terminal window cd to the installation directoryand type:
F2PY
F2PY - the Fortran to Python interface generatorlets SciPy build wrappers that allow the use of Fortran code tocarry out computationally intensive tasks.Download and install in a terminal window by:
AquaTerm
AquaTerm is a graphicsterminal used to display plots. Download aquaterm-1.0.a2.tar.gzand install as follows:Start Aquaterm once by hand (from /Applications/Aquaterm); this appearsto be necessary for automatic calls to work later.
Gnuplot
Gnuplot is a high qualityopen-source plotting package that can be used on its own or by callsfrom within Python. Download gnuplot version 4.0.0 and untar it:
In a terminal type:Test Gnuplot by issuing the command 'gnuplot' in a terminal window;once gnuplot starts, type This should pop up an Aquaterm window with a plot.Calling Gnuplot from Python
Using gnuplot.py lets youcall Gnuplot from within Python. Download and then in a terminal windowcd to the download directory and type
You need to fix one file which this installs. In a terminal changedirectory by issuing the commandEdit the file gp_macosx.py (perhaps using 'pico gp_macosx.py'), changing thelineto
SciPy
Gnuplot Macos Big Sur
SciPy is an open-source libraryof scientific tools for Python.Check out the source files from the CVS repository (seeCVS documentation). This createsa directory scipy. In that directory is a file setup.py that needs one change.Edit this file as follows (perhaps by the command 'pico setup.py')to disable xplt by adding it to the ignore_packages list at the endof the file. That is, replace:with(Thanks to Chris Fonnesbeck for explaining this.)Then in a terminal window type:
Using Gnuplot within Python
Gnuplot For Mac Os
To test Gnuplot, start PythonIDE. Open the file/Library/Python/2.3/Gnuplot/demo.py usingFile->Open.The file opens in PythonIDE's script editor. Look at the file to see typicaluses of gnuplot.py. Click the little black triangle on the upper right edge of the PythonIDEwindow that opens, and choose 'Run as __main__'. Then click 'Run all'.Wait a while before clicking 'OK'.
Gnuplot Mac Download
The examples in demo.py all plot in the same window.You can open plots in multiple windows using:M.D. Johnson, October 18, 2004