如何在Gnuplot中启用pngcairo终端

TMO*_*TTM 15 terminal png gnuplot

我想将一个数字绘制成PNG格式(避免使用转换),但是我的Gnuplot发行版不提供PNGCAIRO终端.我该如何安装/启用它?我在Mac OS X 10.6上使用Gnuplot 4.4,patchlevel 2.

[me]machine @ test $ gnuplot

G N U P L O T
Version 4.4 patchlevel 2
last modified Wed Sep 22 12:10:34 PDT 2010
System: Darwin 10.8.0

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

gnuplot home:     http://www.gnuplot.info
faq, bugs, etc:   type "help seeking-assistance"
immediate help:   type "help"
plot window:      hit 'h'

Terminal type set to 'x11'
gnuplot> set terminal pngcairo
                      ^
     unknown or ambiguous terminal type; type just 'set terminal' for a list
Run Code Online (Sandbox Code Playgroud)

Anv*_*aka 19

如果您正在运行自制程序,则只需一个命令行即可安装所有内容

brew install gnuplot --with-cairo

  • brew中不推荐使用该选项:`brew install gnuplot --with-cairo` (5认同)

mgi*_*son 5

如果您的包管理器(例如macports或者fink)没有合适的gnuplot,那么您可能需要自己从源代码构建gnuplot.Gnuplot本身并不太难,但是如果你想要一个特定的终端(例如pngcairo),你需要在构建gnuplot之前自己下载并构建依赖项 - 在这种情况下libcairo.

png如果您的gnuplot发行版能够libgd在编译时找到或者您的包管理器包含它,那么Gnuplot也有一个常规终端.

告诉您启用哪些终端的简单方法是只输入set terminal交互式gnuplot窗口.那将打印出你的gnuplot能够使用的所有终端的列表(这取决于它编译的库)

对不起,如果这不是很多帮助.


Spa*_*ine 5

我将 gnuplot 升级到 5.0.1 并遇到了同样的问题。这就是我所做的。

要安装 gnuplot 5.0.1,请从这里下载源文件,然后:

#decompress it:
tar -xvf gnuplot-5.0.1.tar.gz

#install the dependency libraries for cairo-based terminals, like pdfcairo, pngcairo
sudo apt-get install libcairo2-dev
sudo apt-get install libpango1.0-dev


#build it:
cd gnuplot-5.0.1 
./configure 
make

#install it:
sudo make install
Run Code Online (Sandbox Code Playgroud)