Gnuplot:安装与使用备忘

news2025/2/28 3:17:06

异常信息

问题起源于 signalp-4.1 调用 gnuplot 进行画图,在画图的时候提示不支持 png 格式结果:

$ gnuplot

        G N U P L O T
        Version 5.0 patchlevel 0    last modified 2015-01-01

        Copyright (C) 1986-1993, 1998, 2004, 2007-2015
        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 'x11'
gnuplot> set term png font "Helvetica,12"  # 您必须在绘图前设置终端和输出文件名
Terminal type set to 'unknown'
                  ^
         unknown or ambiguous terminal type; type just 'set terminal' for a list

gnuplot> set term png font "Helvetica,12";
Terminal type set to 'unknown'
                  ^
         unknown or ambiguous terminal type; type just 'set terminal' for a list

gnuplot> set terminal # 查看 gnuplot 支持的设置格式

Available terminal types:
           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
         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)
             ......

因此考虑重装 gnuplot,以支持 png, jpeg, and gif terminals,具体步骤如下。

安装 GD library 库

GD (https://github.com/libgd/libgd)是一个用于程序员动态创建和处理图像的开源库。手动安装步骤如下。

$ curl -LjO https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz
$ tar zvxf libgd-2.2.5.tar.gz
$ cd libgd-2.2.5
$ ./configure --prefix=/Bioinfo/SoftWare/libgd-2.2.5
$ make 
$ make install

安装 Gnuplot
官网:http://www.gnuplot.info/
注意:
1
configure 时需要把前一步安装好的 libgd 加进去;
2
make install 如遇一下类似 Permission denied, 可忽略,不影响使用。

$ wget http://ftp.cstug.cz/pub/CTAN/graphics/gnuplot/5.2.6/gnuplot-5.2.6.tar.gz
$ tar zvxf gnuplot-5.2.6.tar.gz
$ cd gnuplot-5.2.6
$ ./configure --prefix=/Bioinfo/SoftWare/gnuplot-5.2.6 --with-gd=/Bioinfo/SoftWare/libgd-2.2.5 LDFLAGS="-L/Bioinfo//SoftWare/libgd-2.2.5/lib" CPPFLAGS="-I/Bioinfo/SoftWare/libgd-2.2.5/include" 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
......
** Configuration summary for gnuplot 5.2.6:

gnuplot will be compiled with the following terminals:

  Standalone terminals: yes (always builtin)
    canvas, cgm, context, dumb, dxf, eepic, emf, emtex,
    epslatex, fig, hpgl, latex, metafont, metapost, mif, pcl5,
    postscript, pslatex, pstex, pstricks, qms, svg,
    tek40xx, tek410x, texdraw, tgif, tkcanvas, tpic, vttek

  dot-matrix terminals: no (use --with-bitmap-terminals to enable)
    epson, nec, okidata, tandy, and seiko dp414 printers
    hp500c, hpdj, hpljii, hppj, pbm, sixel, starc

  X Window System terminal: yes
    (with multi-byte fonts)
    (enable plotting to windows opened by external apps)
    (with application defaults, in /etc/X11/app-defaults/)
  linux terminal (vga console): no (use --with-linux-vga to enable)
  vgagl terminal ((s)vga console): no (use --with-linux-vga to enable)
  ggi terminal: no (use --with-ggi to enable, requires libggi)
  gpic terminal: no   (use --with-gpic to enable)
  mif terminal: no   (use --with-mif to enable)
  caca terminal: no (use --with-caca to enable)
  aqua terminal (OSX): no
  libgd-based png, jpeg, and gif terminals: yes (with animated gif)
  cairo-based terminals: no (requires cairo>=1.2, pango>=1.22, glib>=2.28)
  lua/TikZ terminal: no
  wxt terminal: no (requires C++, wxWidgets>2.6, cairo>0.9, pango>1.22)
  Qt terminal: yes (qt4)

  Additional platform-specific or older terminals omitted by default:
   gpic, mif (FrameMaker 3), hp2623a, hp2648, imagen, kyocera
   pm (makefile.os2), be (BeOS), svga (MSDOS/djgpp)
   windows (several options)

gnuplot will be compiled with the following configurable features:

  Mouse support in interactive terminals: yes
  Typing <space> in plot window raises console
  Placement of rectangles and other objects: yes
  Readline library: GNU readline library with  -lncurses
  Command-line history file: yes
  Check current directory for .gnuplot file: no (use --with-cwdrc to enable)
  Sort help/subtopic tables by column: no (use --without-row-help to enable)
  cerf() and other special functions: no (libcerf not found)
  plugin support for loading external functions: yes
  Use TeX kpsexpand to search for fonts: no (use --with-kpsexpand to enable)
  Hidden3d optimization (gridbox/quadtree/none): quadtree
  Allow deprecated syntax: no (use --enable-backwards-compatibility)
  Statistical summary of data ("stats" command): yes
......
$ make
$ make install 
# 如遇一下 Permission denied, 可忽略,不影响使用
......
make[3]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/Bioinfo/APPS/texlive/texmf-local/tex/latex/gnuplot'
/bin/mkdir: cannot create directory `/Bioinfo/APPS/texlive/texmf-local/tex/latex/gnuplot': Permission denied
make[3]: *** [install-texDATA] Error 1
make[3]: Leaving directory `/Bioinfo/Pipeline/src/pkgs/gnuplot-5.2.6/share/LaTeX'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/Bioinfo/Pipeline/src/pkgs/gnuplot-5.2.6/share/LaTeX'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/Bioinfo/Pipeline/src/pkgs/gnuplot-5.2.6/share'
make: *** [install-recursive] Error 1

在这里插入图片描述
注意:configure 的提示(libgd-based png, jpeg, and gif terminals: yes)

  1. 集群运行时,如遇上以下报错,执行一下ldd /Bioinfo/SoftWare/gnuplot-5.2.6/bin/gnuplot,把缺失的对应指向的 libQt*.so 拷贝到一个指定目录,然后增加一个export LD_LIBRARY_PATH=/Bioinfo/SoftWare/gnuplot-5.2.6/customlib:$LD_LIBRARY_PATH即可。
gnuplot: error while loading shared libraries: libQtNetwork.so.4: cannot open shared object file: No such file or directory

在这里插入图片描述

简单绘图

安装完成后,进入 gnuplot 简单画图并保存为 plot.png。

gnuplot> set term png font "Helvetica,12"

Terminal type is now 'png'
Options are 'nocrop enhanced size 640,480 font "Helvetica,12.0" '
gnuplot> set output "plot.png"
gnuplot> plot sin(x)
gnuplot> exit

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1030533.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

服务网格的工作原理:解析服务网格的核心组件和通信模式

&#x1f337;&#x1f341; 博主猫头虎 带您 Go to New World.✨&#x1f341; &#x1f984; 博客首页——猫头虎的博客&#x1f390; &#x1f433;《面试题大全专栏》 文章图文并茂&#x1f995;生动形象&#x1f996;简单易学&#xff01;欢迎大家来踩踩~&#x1f33a; &a…

实用!Python大型Excel文件处理:快速导入、导出与批量处理

Python 是一种功能强大的编程语言&#xff0c;它提供了丰富的库和工具&#xff0c;使得处理大型 Excel 文件变得容易和高效。下面将介绍如何使用 Python 快速导入、导出和批量处理大型 Excel 文件。下面是一些建议和实践经验&#xff0c;希望能对你有所帮助。 一、Excel 文件处…

【C语言】求一个整数的二进制序列中1的个数的三种方法

方法一&#xff1a;逐位%2法 该方法的初步测试代码如下: int NumberOf1(int n) {int count 0;while (n){if (n % 2 1){count;}n n / 2;}return count; } 众所周知&#xff0c;数据在内存里以补码的形式存储&#xff0c;这是为了简化计算机的结构设计&#xff0c;同时也提…

SpringBoot集成Prometheus实现监控

SpringBoot配置Prometheus pom.xml 引入监控以及prometheus依赖 <dependency><groupId>io.micrometer</groupId><artifactId>micrometer-registry-prometheus</artifactId></dependency><dependency><groupId>org.springfram…

Excel——时间戳与标准北京时间的互相转换

一、背景 在excel中将13位毫秒级别的时间戳转换为标准的日期格式(yyyy-mm-dd hh:mm:ss.000)&#xff0c;使用如下模板 TEXT(<source_cell>/1000/8640070*36519,"yyyy-mm-dd hh:mm:ss.000") 在excel中将10位秒级别的时间戳转换为标准的日期格式(yyyy-mm-dd h…

【华为云云耀云服务器L实例评测】- 云原生实践,快捷部署人才招聘平台容器化技术方案!

&#x1f935;‍♂️ 个人主页: AI_magician &#x1f4e1;主页地址&#xff1a; 作者简介&#xff1a;CSDN内容合伙人&#xff0c;全栈领域优质创作者。 &#x1f468;‍&#x1f4bb;景愿&#xff1a;旨在于能和更多的热爱计算机的伙伴一起成长&#xff01;&#xff01;&…

WebGL 选中一个表面

目录 选中一个表面 示例程序&#xff08;PickFace.js&#xff09; 代码详解 示例效果 选中一个表面 ​​​​​​​WebGL 选中物体_山楂树の的博客-CSDN博客可以使用同样的方法来选中物体的某一个表面。这一节在PickObject程序的基础上编写了PickFace程序&#xff0c;后…

计算机毕业设计 基于SSM+Vue的物资存储系统(以消防物资为例)的设计与实现 Java实战项目 附源码+文档+视频讲解

博主介绍&#xff1a;✌从事软件开发10年之余&#xff0c;专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精…

docker安装使用xdebug

docker安装使用xdebug 1、需要先安装PHP xdebug扩展 1.1 到https://pecl.php.net/package/xdebug下载tgz文件&#xff0c;下载当前最新稳定版本的文件。然后把这个tgz文件放到php/extensions目录下&#xff0c;记得install.sh中要替换解压的文件名&#xff1a; installExtensio…

uniapp 离线打包 plus.runtime.install 安装页面不弹起

uniapp 离线打包 plus.runtime.install 安装页面不弹起 updateVersion(webview : any, eventTitle : string, eventContent : string) {const loading plus.nativeUI.showWaiting(准备下载);var dtask plus.downloader.createDownload(eventContent,{method: GET,timeout: 5…

银行存款问题:整存零取

整存零取月息为0.63%&#xff0c;每年底取出1000&#xff0c;五年刚好取完&#xff0c;计算最初存入金额。 (本笔记适合基本熟悉一门编程语言的 coder 翻阅) 【学习的细节是欢悦的历程】 Python 官网&#xff1a;https://www.python.org/ Free&#xff1a;大咖免费“圣经”教程…

Ae 效果:CC Wide Time

时间/CC Wide Time Time/CC Wide Time CC Wide Time &#xff08;CC 宽泛时间&#xff09;能够将前后不同时间的帧叠加在一起&#xff0c;从而创建移动物体的运动轨迹&#xff0c;实现重影、运动模糊、光影跟随等效果。 可以配合其它的效果使得本效果有更多的可控性。 比如&…

py实验一

2、九九乘法表。 编写程序&#xff0c;输出九九乘法表。 源代码&#xff1a; for a in range(1, 10): for b in range(1, a1): print(f"{a}*{b}{a * b}", end" ") print() 列出测试数据和实验结果截图&#xff1a; 3、编写程序&#xff0…

progeny PROGENy

单细胞之富集分析-6&#xff1a;PROGENy - 简书 (jianshu.com) #request 2 .libPaths(c( "/home/data/t040413/R/x86_64-pc-linux-gnu-library/4.2","/home/data/t040413/R/yll/usr/local/lib/R/site-library", "/home/data/refdir/Rlib/", &qu…

tdesign的文件上传(微信小程序+idea的springboot)

目录 1. springboot后端 1.1 FileController.java 1.2 listener文件的ErpApplicationListener.java 1.3 【重点&#xff01;】FileServiceImpl层 1.4 IFileService 1.5 StringUtil通用类 1.6 主程序加一个监听器 1.7 application.yml文件 2. 微信小程序端 2.1 TDesign的…

数据结构与算法——13.队列的拓展

这篇文章主要讲一下双端队列&#xff0c;优先队列&#xff0c;阻塞队列等队列的拓展内容。 目录 1.队列拓展概述 2.双端队列的链表实现 3.双端队列的数组实现 4.优先队列无序数组实现 5.阻塞队列 6.总结 1.队列拓展概述 首先来看一张图&#xff0c;来大致了解一下他们的…

TorchLens--可视化任何PyTorch模型

0. 简介 PyTorch是一个深度学习框架&#xff0c;它使用张量&#xff08;tensor&#xff09;作为核心数据结构。在可视化PyTorch模型时&#xff0c;了解每个张量运算的意义非常重要。张量运算作为神经网络模型中的基本操作。它们用于处理输入数据、执行权重更新和生成预测结果。…

Python:获取当前目录下所有文件夹名称及文件夹下所有文件名称

获取当前目录下所有文件夹名称 def get_group_list(folder_path):group_list []for root, dirs, files in os.walk(folder_path):for dir in dirs:group_list.append(dir)return group_list获取文件夹下所有文件名称 def get_file_list(folder_path, group_name):file_list …

【zookeeper】基于Linux环境安装zookeeper集群

前提&#xff0c;需要有几台linux机器&#xff0c;我们可以准备好诸如finalshell来连接linux并且上传文件&#xff1b; 其次Linux需要安装上ssh&#xff0c;并且在/etc/hosts文件中写好其他几台机器的名字和Ip 127.0.0.1 localhost localhost.localdomain localhost4 localh…

canal简单介绍

简介 https://github.com/alibaba/canal 基于 MySQL 数据库增量日志解析&#xff0c;提供增量数据订阅和消费 原理是使用程序模拟一个mysql的从库&#xff0c;使主库发送同步日志给程序&#xff0c;程序再对数据进行处理&#xff0c;比如同步到其他数据库。 使用 下图是一个…