Install gnuplot 5.0.1 on OSX

江枫思渺然 提交于 2019-11-29 01:03:18

To minimise my effort, I tend to use package managers to install command line tools as much as possible.

For OS X I recommend using homebrew. Installing gnuplot with homebrew is as easy as typing: brew install gnuplot

The best way to use gnuplot on MacOS is to set it to work with aquaterm as opposed to X11. Here is what I did to do so on both Yosemite and El Capitan MacOS:

  1. First remove all pre installation of gnuplot and aquaterm, if any:
    • Brew uninstall gnuplot
    • Manually delete Aquaterm if you installed it via dmg file previously from your application.
    • If you installed Aquaterm using brew then use brew uninstall aquaterm.

bottomline: You shouldn't have any installation of gnuplot or aquaterm on your system.

  1. Now install aqua term using brew command:
    • brew install Caskroom/cask/aquaterm
  2. Then install gnuplot using follwing command:
    • brew install gnuplot --with-aquaterm --with-qt4
  3. Finally, run following command to create a shortcut of gnuplot in your path
    • ln -s /usr/local/Cellar/gnuplot/5.0.4/bin/gnuplot /usr/local/bin/gnuplot

That is all; just notice that the location of gnuplot might be different if brew has installed a different version of gnuplot.

Now if you run gnuplot in your terminal you should see something like this: the output of gnuplot command

Thanks to @irundaia answer plus some Google search, I finally got gnuplot working with my favorite x11 terminal. Here's the workflow: in a terminal type:

brew uninstall gnuplot
brew install gnuplot --with-x11

The first command uninstall a previous gnuplot installed with homebrew. The second command installs gnuplot by specifying the x11 terminal. This way, opening gnuplot sets the terminal automatically to x11, and the warning messages about "gnuplot_qt" and "slow font initialization" disappeared!

Raj

I ran into similar issues while I was testing few algorithms using Octave, so I did the following which resolved the issues.

You can try this, if you already have GNUPLOT installed, please uninstall it using brew uninstall gnuplot.

  • Download Aquaterm from this location.
  • Once download is complete, follow the instructions for the installation
  • Open Aquaterm x.x.x.dmg
  • Double click AquatermInstaller.pkg
  • Follow the installation wizard.
  • Once Aquaterm installation is complete, install gnuplot using the below command

    brew install gnuplot –with-aquaterm —-with-qt4
    

    The above command along with gnu plot installation, also configures the terminal type to aqua, which means you don’t have to run setenv command post installation. To confirm, run the command “gnuplot” in the terminal and at the bottom of the result, you should see “Terminal type set to aqua”.

To verify the installation and configuration, run the below test in Octave:

x = 1:10
y = 1:10
plot(x,y)

that should launch aquaterm along with the graph.

user10081298

please set below environment parameters correctly.

GNUPLOT_DRIVER_DIR = "/usr/local/libexec/gnuplot/5.2"
GNUPLOT_PS_DIR     = "/usr/local/share/gnuplot/5.2/PostScript"
HELPFILE           = "/usr/local/share/gnuplot/5.2/gnuplot.gih"

for example:

export GNUPLOT_DRIVER_DIR="/home/boris/local/libexec/gnuplot/5.2"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!