“Mac上的GNUPLOT”;x11“中止”;

“Mac上的GNUPLOT”;x11“中止”;,gnuplot,homebrew,Gnuplot,Homebrew,要使用x11安装gnuplot,我使用了以下命令: brew install gnuplot --with-x11 我正在运行OS X EL Capitan版本10.11.6。当我运行gnuplot时,我获得: G N U P L O T Version 5.0 patchlevel 5 last modified 2016-10-02 Copyright (C) 1986-1993, 1998, 2004, 2007-2016 Thomas Williams,

要使用
x11
安装
gnuplot
,我使用了以下命令:

brew install gnuplot --with-x11
我正在运行OS X EL Capitan版本10.11.6。当我运行gnuplot时,我获得:

    G N U P L O T   Version 5.0 patchlevel 5    last modified 2016-10-02

    Copyright (C) 1986-1993, 1998, 2004, 2007-2016  Thomas Williams, Colin Kelley and many others

    gnuplot home:     http://www.gnuplot.info   faq, bugs, etc:   type "help FAQ"   immediate help:   type "help"  (plot window: hit 'h')

Terminal type set to 'unknown'
然后我试着画一些简单的东西,比如sin(x),我得到了错误

gnuplot: unable to open display ''
gnuplot: X11 aborted.

有什么建议吗

首先,如果您还没有,您必须键入命令

set term x11
 brew uninstall gnuplot
 brew install gnuplot --with-qt
这是最基本的,因为如果没有设置
术语
,就无法获得输出。 然后,如果它仍然不工作,请尝试卸载gnuplot,并使用另一个终端重新安装,例如
qt
终端(这也很好,因为如果您有3D绘图,您可以与之交互),方法是使用命令

set term x11
 brew uninstall gnuplot
 brew install gnuplot --with-qt
或者,如果您真的需要
x11
作为终端,您可以查看一下(似乎有人已经有过类似的问题)

此外,键入
set term
可能会有所帮助,并为您提供预安装的gnuplot终端的完整列表,并且请记住,如果您在gnuplot指南之前有问题检查,可以使用命令
help“ANYTHING_INSIDE_gnuplot”
,在您的情况下:

help term

使用
--with-x11
安装时,请确保已安装
XQuartz

否则,尝试用QT重新安装
gnuplot
,例如

brew reinstall gnuplot --with-qt

安装XQuartz后,在
设置术语x11
生效之前,我必须注销并再次登录。

您安装了XQuartz吗?当您只需键入
set term
时,x11是否显示?