我从源forge页面下载了gnuplot 5.0.1的源文件(gnuplot-5.0.1.tar.gz)。我还在我的OS X 10.7.5上安装了命令行工具,使得/usr/bin
文件夹下有gcc
和make
。
我按照tarball中的INSTALL.gnu
文件中的安装说明进行操作:运行了configure
文件,然后分别输入了make
、make check
、make install
和make clean
。这些命令将gnuplot
安装在/usr/local/bin/
目录下。
make check
命令在测试许多gnuplot脚本之前,在shell中输出了很多行信息。我实际上可以看到绘图,并且认为“太好了,它可以用了”。因此,我打开一个新的终端shell并输入gnuplot
以开始使用它(终端自动设置为qt)。但是,一个简单的plot sin(x)
却失败了。Gnuplot返回如下信息:
Could not start gnuplot_qt with path "/usr/local/libexec/gnuplot/5.0/gnuplot_qt"
Could not start gnuplot_qt with path "/usr/local/libexec/gnuplot/5.0/gnuplot_qt"
Could not connect to gnuplot_qt "" . Starting a new one
Could not start gnuplot_qt with path "/usr/local/libexec/gnuplot/5.0/gnuplot_qt"
Warning: slow font initialization . . . . . . . . .
Warning: slow font initialization . . . . . . . . .
Warning: slow font initialization . . . . . . . . .
Warning: slow font initialization . . . . . . . . .
…
如果我不关闭终端,警告消息就会无限地出现。
brew install gnuplot
将安装最新版本(目前为5.0.1)。通常,不同的主要版本会有不同的软件包(公式)。例如,如果您想安装gnuplot 4,则可以使用brew install homebrew/versions/gnuplot4
。如果有疑问,始终可以访问http://braumeister.org,该网站显示有关软件包的一些详细信息。 - irundaiabrew uninstall gnuplot && brew install gnuplot --with-x11
。这样打开 gnuplot 时会自动设置终端为 x11。 - dada