绘图小能手gunplot

下面的安装过程是在ubuntu20.04上进行的。

安装gnuplot需要依赖lua5.2。所以先安装lua5.2

安装lua5.2

下载安装包

wget http://www.tecgraf.puc-rio.br/lua/ftp/lua-5.2.0.tar.gz

编译安装lua5.2

解压后进入源码目录

make linux
sudo make install

安装gnuplot

gnuplot主页:http://www.gnuplot.info/

gnuplot需要编译源码安装。首先到下面的网址下载源码。

下载网址:

https://sourceforge.net/projects/gnuplot/files/gnuplot/5.4.3/

编译安装gnuplot

./configure              # prepare Makefile and config.h
make                     # build the program and documentation
make check               # run unit tests to confirm successful build
sudo make install             # install the program and documentation

使用gnuplot

将下面的内容保存为show.plt。替换需要显示的数据文件,然后执行该脚本即可。

#!/usr/local/bin/gnuplot

set size ratio -1;
plot "test_path.txt" using 1:2:3 with labels offset -1,0.5 point pt 1 ps 1 lc rgb "blue" notitle
# plot "test2" u 1:2 t "Dawn" pt 1 ps .1
# plot "weird.path" u 1:2 smooth bezier
pause -1;

该脚本支持的数据存储形式为

42.7901 36.8747 0
43.3355 36.8601 1
43.99 36.9039 2

显示效果:

gnuplot还有很多功能,这样简单介绍一下。


觉得有用就点赞吧!

我是首飞,一个帮大家填坑的机器人开发攻城狮。

另外在公众号《首飞》内回复“机器人”获取精心推荐的C/C++,Python,Docker,Qt,ROS1/2等机器人行业常用技术资料。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

首飞爱玩机器人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值