gnuplot 使用示例

安装部署:

#centos/redhat
yum install gnuplot
#macos
brew install gnuplot
#ubuntu
sudo apt install gnuplot

数据文件

ashe@macos:~/data/test/test_gnuplott $ cat t1.txt
1     1   2.1
2     4   4.5
3     900   6
4    16   8
5    25   10
6    36   11
7    49   12
8    64   13
9    81   14
10  100   15

双曲线

plot 't1.txt' using  1:2 with linespoints title 'a' ,'t1.txt' using 1:3 with linespoints title 'b'

在这里插入图片描述

带纵坐标值的双曲线

 plot "t1.txt" using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, "" using 1:2:2 with labels title 'a',"t1.txt" using 1:3 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, "" using 1:3:3 with labels title 'b'

在这里插入图片描述

shell一键执行获取图片

ashe@macos:~/data/test/test_gnuplott $ gnuplot -e "set terminal jpeg;set output 'ashe.jpeg';plot 't1.txt' using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, '' using 1:2:2 with labels title 'a','t1.txt' using 1:3 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, '' using 1:3:3 with labels title 'b'"
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200721225215925.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3N1bl9hc2hl,size_16,color_FFFFFF,t_70)

在这里插入图片描述

gnuplot -e "set xlabel 'threads';set ylabel 'tps'; set key top left;set size ratio 0.7;set terminal png;set output 'ashe.png';plot 'res-1.txt'  using 1:2:2 with labels title '', '' using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 0.2  title 'disk-m','res-2.txt'  using 1:2:2 with labels title '', '' using 1:2 with linespoints linecolor 5 linewidth 1 pointtype 5 pointsize 0.2 title 'disk-ssd'"
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值