Chinaunix首页 | 论坛 | 博客
  • 博客访问: 278317
  • 博文数量: 66
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 455
  • 用 户 组: 普通用户
  • 注册时间: 2015-11-25 09:52
个人简介

no pains no gains

文章分类

全部博文(66)

文章存档

2017年(10)

2016年(39)

2015年(17)

我的朋友

分类: 系统运维

2016-05-06 11:17:30

Gnuplot绘图实现shell数据图形化:
首先:yum install 安装gnuplot
安装后输入gnuplot,进入调试模式
gnuplot>
也可以写文档:如XXX.conf
set terminal png truecolor   // 设置图片类型
set output "/root/html/conf.png"  //设置图片路径
set autoscale
set xdata time  //设置X轴时间轴
set timefmt "%H:%M:%S "  //数据格式
set xtics format "%H:%M:%S"  //显示格式
set yrange [0:80]  // y轴的范围
set style data lines //化纤方式
set grid //背景线
plot "result.txt" using 1:2 title "CONFNUM"  // 读取 result.txt的结果 以第一列为X轴 第二列为Y轴 表示线的名称为 “CONFNUM”
绘图的话,直接执行命令
cat result.txt | gnuplot
============================================================================
result.txt的数据
10:16:05 46
11:16:42 45
12:17:22 48
13:18:01 47
14:18:41 48
14:19:21 49
16:20:01 46
16:20:41 48
17:21:20 49
18:22:00 48
19:22:40 50
20:23:20 50
21:24:00 48
22:24:40 48
23:25:20 48
23:26:00 48
绘图结果



阅读(1485) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~