Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Terminal 如何在Gnuplot中启用pngcairo终端_Terminal_Png_Gnuplot - Fatal编程技术网

Terminal 如何在Gnuplot中启用pngcairo终端

Terminal 如何在Gnuplot中启用pngcairo终端,terminal,png,gnuplot,Terminal,Png,Gnuplot,我想将一个图形绘制为PNG格式(避免使用convert),但是我的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 Copyri

我想将一个图形绘制为PNG格式(避免使用convert),但是我的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
如果您的包管理器(例如,
macports
fink
)没有合适的gnuplot,那么您可能需要自己从源代码构建gnuplot。Gnuplot本身并不太难,但是如果您想要一个特定的终端(例如,
pngcairo
),您需要在构建Gnuplot之前下载并构建依赖项——在本例中是
libcairo

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

判断您启用了哪些终端的简单方法是在一个交互式gnuplot窗口中键入
set terminal
。这将打印您的gnuplot能够使用的所有终端的列表(这取决于编译它时使用的库)

如果没有太多帮助,很抱歉。

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


brew安装gnuplot——使用cairo

我将gnuplot升级到5.0.1,并遇到相同的问题。这就是我要做的

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


sudo-apt-get-install-libcairo2-dev
更简单。该选项在brew中已被弃用:
brew-install-gnuplot--with-cairo
#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