一、下载gnuplot
http://www.gnuplot.info/
二、将下载完的 gnuplot-5.4.2.tar.gz上传到Linux并解压
[root@WzcWyt wyt]# ll
-rw-r--r-- 1 root root 5640202 Sep 13 10:12 gnuplot-5.4.2.tar.gz
[root@WzcWyt wyt]# tar -zxvf gnuplot-5.4.2.tar.gz
[root@WzcWyt wyt]# ll
drwxr-xr-x 11 2505 users 4096 May 29 13:55 gnuplot-5.4.2
-rw-r--r-- 1 root root 5640202 Sep 13 10:12 gnuplot-5.4.2.tar.gz
三、进入gnuplot-5.4.2安装
[root@WzcWyt wyt]# cd gnuplot-5.4.2/
# 配置安装路径
[root@WzcWyt gnuplot-5.4.2]# ./configure
# 编译
[root@WzcWyt gnuplot-5.4.2]# make
# 安装
[root@WzcWyt gnuplot-5.4.2]# make install
四、安装成功
[root@WzcWyt ~]# gnuplot -e "set terminal dumb;plot sin(x)"
1 +--------------------------------------------------------------------+
| * * + * ** + * * |
0.8 |-+ * * * * sin(x* *******-|
| * * * * * * |
0.6 |-+ * * * * * * +-|
| * * * * * * |
0.4 |*+ * * * * * *+-|
|* * * * * * * |
0.2 |*+ * * * * * *+-|
| * * * * * * * |
0 |-* * * * * * *-|
| * * * * * * *|
-0.2 |-+* * * * * * +*|
| * * * * * * *|
-0.4 |-+* * * * * * +*|
| * * * * * * |
-0.6 |-+ * * * * * * +-|
| * * * * * * |
-0.8 |-+ * * * * * * +-|
| * * + ** * + * * |
-1 +--------------------------------------------------------------------+
-10 -5 0 5 10
[root@WzcWyt ~]#
遇见问题
[root@WzcWyt wyt]# gnuplot
G N U P L O T
Version 5.4 patchlevel 2 last modified 2021-06-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2021
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 is now 'unknown'
gnuplot> plot sin(x)
WARNING: Plotting with an 'unknown' terminal.
No output will be generated. Please select a terminal with 'set terminal'.
# 解决办法:设置终端dumb
gnuplot> set terminal dumb
Terminal type is now 'dumb'
Options are 'feed size 79, 24 aspect 2, 1 mono'
gnuplot> plot sin(x)
1 +--------------------------------------------------------------------+
| * * + * ** + * * |
0.8 |-+ * * * * sin(x* *******-|
| * * * * * * |
0.6 |-+ * * * * * * +-|
| * * * * * * |
0.4 |*+ * * * * * *+-|
|* * * * * * * |
0.2 |*+ * * * * * *+-|
| * * * * * * * |
0 |-* * * * * * *-|
| * * * * * * *|
-0.2 |-+* * * * * * +*|
| * * * * * * *|
-0.4 |-+* * * * * * +*|
| * * * * * * |
-0.6 |-+ * * * * * * +-|
| * * * * * * |
-0.8 |-+ * * * * * * +-|
| * * + ** * + * * |
-1 +--------------------------------------------------------------------+
-10 -5 0 5 10
# 退出
gnuplot> q
[root@WzcWyt wyt]#