【问题标题】:pdfcairo 'unknown or ambiguous terminal type' in gnuplotgnuplot中的pdfcairo'未知或不明确的终端类型'
【发布时间】:2015-07-27 14:04:14
【问题描述】:

将gnuplot从4.6升级到5.0.1后,遇到如下错误:

set terminal pdfcairo size 3.0in,2.25in font ',8'
             ^
"plot.plt", line 114: unknown or ambiguous terminal type; type just 'set terminal' for a list

我该如何解决?

PS:pdfcairo 在之前的版本 (4.6) 中运行良好。

我通过以下命令安装 gnuplot:

#build it:
./configure --with-cairo 
make

#install it:
sudo make install

GNUPLOT Version 5.0.1 Release Notes 中所述,默认情况下包含pdfcairo

Cairo/pango/wxWidgets 这组终端包括

pngcairo、pdfcairo、epscairo 和 cairolatex 用于输出到文件

wxt 用于交互式显示所有这些都将默认构建,如果 配置脚本找到所需的 libcairo、libpango、libcairo、 libwxgtk 和相关支持库 要禁用这些终端:

./configure --without-cairo ./configure --with-cairo --disable-wxt

【问题讨论】:

  • 从源代码构建 gnuplot 时,您必须安装相应的开发库和头文件。
  • @Christoph,谢谢你的提醒。我做到了。请检查答案。

标签: pdf-generation gnuplot cairo pangocairo


【解决方案1】:

我用@Christoph 的善意提醒解决了这个问题。

要解决这个问题,请通过以下命令为 cairo 终端 安装依赖库:

sudo apt-get install libcairo2-dev
sudo apt-get install libpango1.0-dev

然后再次编译gnuplot:

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

#install it:
sudo make install

现在,一切都很好。享受它:-)

gnuplot> set term

Available terminal types:
       cairolatex  LaTeX picture environment using graphicx package and Cairo backend
           canvas  HTML Canvas object
              cgm  Computer Graphics Metafile
          context  ConTeXt with MetaFun (for PDF documents)
            corel  EPS format for CorelDRAW
             dumb  ascii art for anything that prints text
              dxf  dxf-file for AutoCad (default size 120x80)
            eepic  EEPIC -- extended LaTeX picture environment
              emf  Enhanced Metafile format
            emtex  LaTeX picture environment with emTeX specials
         epscairo  eps terminal based on cairo
         epslatex  LaTeX picture environment using graphicx package
              fig  FIG graphics language for XFIG graphics editor
             hpgl  HP7475 and relatives [number of pens] [eject]
            latex  LaTeX picture environment
               mf  Metafont plotting standard
               mp  MetaPost plotting standard
             pcl5  HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
         pdfcairo  pdf terminal based on cairo
         pngcairo  png terminal based on cairo
       postscript  PostScript graphics, including EPSF embedded files (*.eps)
Press return for more: 

【讨论】:

  • 对 Centos/RedHat/Fedora 执行以下命令。 $ sudo yum install cairo-devel pango-devel $ cd [gnuplot-directory] ​​$ ./configure $ make $ make install
猜你喜欢
  • 2012-11-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-31
  • 2017-03-07
  • 1970-01-01
相关资源
最近更新 更多