How to Install Gnuplot on macOS (Homebrew & MacPorts)

The easiest way to install gnuplot on macOS is Homebrew: run brew install gnuplot, then verify with gnuplot --version. There is no official macOS binary package from the gnuplot project, so a package manager (or building the source tarball) is the normal route.

Option 1: Homebrew (Recommended)

  1. Install Homebrew if you do not have it. Paste the install command from the official Homebrew site (brew.sh) into Terminal and follow its prompts.
  2. Install gnuplot:
    brew install gnuplot

    Homebrew downloads gnuplot and its dependencies (such as the Qt terminal libraries) and places the binary in /opt/homebrew/bin on Apple Silicon Macs or /usr/local/bin on Intel Macs — both are on your PATH automatically.

  3. Verify:
    gnuplot --version

    You should see a line such as gnuplot 6.0 patchlevel 5 if Homebrew is serving the current release, or a slightly older patchlevel if the formula has not caught up yet.

  4. First plot:
    gnuplot
    plot sin(x)

    A Qt window with a sine curve confirms the graphical terminal works.

Option 2: MacPorts

If you already use MacPorts, the equivalent is:

sudo port install gnuplot

Then run the same gnuplot --version check.

About Versions

Homebrew and MacPorts usually track gnuplot releases closely, but they can lag the newest SourceForge release by a few weeks. If you need exactly 6.0.5 today, download the source tarball (gnuplot-6.0.5.tar.gz) from the download page and build it, or simply use the package-manager build — for almost all plotting work the difference is negligible.

Common Pitfalls

  • “command not found: gnuplot” right after a Homebrew install: open a new Terminal window, or run the shell setup line Homebrew printed at the end of its own installation (brew shellenv).
  • Expecting a .dmg installer: the gnuplot project does not publish one. Any site offering a “gnuplot for Mac installer” is a third-party bundle — the package-manager route above is the safe standard.

For the full pre-flight checklist, see how to verify your gnuplot installation.

Back up your plot scripts and data

Your .gp scripts and data files are small but hard to recreate. Keeping a synced backup means a reinstall never costs you your work. pCloud offers cloud storage with a one-time lifetime option and syncs a scripts folder across machines automatically. Affiliate link — see our Affiliate Disclosure.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *