2015-09-06 145 views
16

我從source forge page下載了gnuplot 5.0.1(gnuplot-5.0.1.tar.gz)的源文件。我還在我的OS X 10.7.5上安裝了命令行工具,以便我在/usr/bin文件夾中有gccmake在OSX上安裝gnuplot 5.0.1

我跟着INSTALL.gnu文件壓縮包中的安裝說明:我跑的configure文件和類型makemake checkmake installmake clean。通過這些命令,gnuplot位於/usr/local/bin/

在測試許多gnuplot腳本之前,make check命令會在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 . . . . . . . . . 

… 

警告消息不斷出現無限的,如果我不關閉終端。

回答

36

爲了儘量減少我的工作,我傾向於使用包管理器儘可能地安裝命令行工具。

對於OS X,我推薦使用homebrew。使用自制軟件安裝gnuplot就像打字一樣簡單: brew install gnuplot

+1

如何知道該命令將安裝哪個版本的gnuplot? – dada

+1

Bij默認'brew install gnuplot'將安裝最新版本(當前爲5.0.1)。 通常,不同的主要版本會有不同的軟件包(公式)。例如,如果你想安裝gnuplot 4,你可以使用'brew install homebrew/versions/gnuplot4' 如果有疑問,總會有:http://braumeister.org,它顯示了一些關於軟件包的細節。 – irundaia

+1

好的,所以我已經用自制軟件安裝了gnuplot 5.0.1,但是x11終端不可用。如果我需要在將它們保存到png或其他終端之前檢查我的地塊,我應該使用哪個終端? – dada

10

在MacOS上使用gnuplot的最佳方法是將其設置爲與aquaterm相對,而不是X11。下面是我做的,以在兩個優勝美地埃爾卡皮坦MacOS的這樣做:

  1. 首先拆下的gnuplot和aquaterm的所有預安裝,如果有的話:
    • Brew uninstall gnuplot
    • 手動刪除Aquaterm如果您安裝它通過以前從您的應用程序dmg文件。
    • 如果您使用brew安裝Aquaterm,然後使用brew uninstall aquaterm

底線:你不應該有gnuplot的或aquaterm的任何安裝在系統上。

  • 現在使用釀造命令安裝AQUA術語:
    • brew install gnuplot --with-aquaterm --with-qt4
    • brew install Caskroom/cask/aquaterm
  • 然後,使用follwing命令安裝gnuplot的
  • 最後,運行以下命令創建在路徑
    • ln -s /usr/local/Cellar/gnuplot/5.0.4/bin/gnuplot /usr/local/bin/gnuplot
  • 的gnuplot的快捷方式這是所有;只要注意,如果brew安裝了不同版本的gnuplot,則gnuplot的位置可能會不同。

    現在,如果你在你的終端上運行gnuplot你應該看到這樣的事情: the output of gnuplot command

    +6

    不再支持QT4。現在就使用QT。:'brew install gnuplot --with-aquaterm --with-qt' – ckg

    +0

    Aquaterm不適合我。我只是沒有看到任何窗口。 –

    0

    我遇到了類似的問題,而我是測試用倍頻數的算法,所以我也該解決的問題如下。

    您可以試試這個,如果您已經安裝了GNUPLOT,請使用brew uninstall gnuplot將其卸載。

    • this位置下載Aquaterm。
    • 下載完成後,按照說明安裝
    • 打開Aquaterm x.x.x.dmg
    • 雙擊AquatermInstaller.pkg
    • 按照安裝嚮導。
    • 一旦Aquaterm安裝完成後,使用下面的命令

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

      與GNU情節安裝沿上述命令安裝gnuplot,還配置終端類型設置爲淺綠色,這意味着你不必運行setenv命令安裝後。要確認,在終端和結果的底部運行命令「gnuplot」,你應該看到「終端類型設置爲aqua」。

    要驗證的安裝和配置,在八度運行以下測試:

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

    應與該圖形沿着推出aquaterm。

    2

    感謝@irundaia回答加上一些Google搜索,我終於得到了gnuplot與我最喜愛的x11終端合作。這裏的工作流程:在一個終端類型中:

    brew uninstall gnuplot 
    brew install gnuplot --with-x11 
    

    第一個命令卸載以前用自制軟件安裝的gnuplot。第二個命令安裝指定x11終端的的gnuplot。 這樣,打開gnuplot會自動將終端設置爲x11,並且關於「gnuplot_qt」和「慢字體初始化」的警告消息消失了