「Gnuplot」

认识

官网:http://www.gnuplot.info/
文档:http://www.gnuplot.info/docs_6.1/Gnuplot_6.pdf
仓库:https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/

Gnuplot is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don’t have to pay for it).

It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986.

组成

—— 该部分将介绍 Gnuplot 组成,例如架构、组件、交互等等,以帮助我们掌握 Gnuplot 的构造方法。

构建

—— 该部分将介绍获得 Gnuplot 服务的方法。我们更加关注于 Gnuplot 的使用,而非“从零开始构造 Gnuplot 工具”。

编译、安装

./configure --prefix=/usr/local

# 关于编译中的错误,请查看本文 Error List 部分;
make

make install

Error List

#1 …libX11.so.6: error adding symbols: DSO missing from command line

……
/usr/bin/ld: wxterminal/wxt_gui.o: undefined reference to symbol ‘XInitThreads’
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
……

解决:
wxt_gui.o 链接的时候出现了问题,wxwidgets 是个 UI 框架,它和 QT、GTK 是一类东西(不是很准确);
为什么 gnuplot 要使用 wxwidgets?gnuplot 生成的图会在图形界面中显示,加入 wxwidgets,使 gnuplot 支持 wxwidgets;
但其实,在 gnuplot 同时可以编译多个 UI 框架(qt4/5, x11, wxwidgets),所以不用 wxwidgets 了(实际上并不推荐这么解决问题):

–disable-wxwidgets

参考文献

Homepage: http://gnuplot.sourceforge.net, http://www.gnuplot.info
Doc: http://gnuplot.sourceforge.net/documentation.html