使用 gnuplot 画图
2015-03-14 01:28
513 查看
1) 安装:
2)画图:
先执行gnuplot,进入交互模式:
可以把这个图保存为图片文件。 可以是 jpeg, png等格式。
3)数据可视化
假如有下面的一组数据:
可以用gnuplot把数据画出来:
默认只画前两列。可以使用下面的方法把第三列画出来 (把第三列当做误差):
最后,可以使用save命令把执行的命令保存到文件里。以后,只要 执行 load命令,就会执行相应的命令了。
参考:
1. http://www.gnuplot.info/help.html
sudo aptitude install gnuplot-x11
2)画图:
先执行gnuplot,进入交互模式:
$ gnuplot G N U P L O T Version 4.6 patchlevel 4 last modified 2013-10-02 Build System: Linux i686 Copyright (C) 1986-1993, 1998, 2004, 2007-2013 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 set to 'wxt' gnuplot>同时画指数函数 x^0.5, 对数函数 lnx. x范围设定 为 [0,1000]
gnuplot> set xrange [0:1000]; plot x**(0.5),log(x)
可以把这个图保存为图片文件。 可以是 jpeg, png等格式。
gnuplot> set terminal jpeg Terminal type set to 'jpeg' Options are 'nocrop font "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf,12" fontscale 1.0 size 640,480 ' gnuplot> set output 'function.jpg' gnuplot> replot然后,可以在当前目录下找到文件 "function.jpg"
3)数据可视化
假如有下面的一组数据:
$ cat test.dat 0.0000 5.5000 0.9322 0.2500 3.5781 0.3983 0.5000 0.0000 0.2844 0.7500 -3.0288 0.2348 1.0000 -3.9409 0.6686 1.2500 -2.5639 0.3601 1.5000 0.0000 0.2369 1.7500 2.1702 0.0262 2.0000 2.8238 0.3629 2.2500 1.8371 0.5087 2.5000 0.0000 0.4358 2.7500 -1.5550 0.366 3.0000 -2.0233 0.2310 3.2500 -1.3163 0.3458 3.5000 0.0000 0.2075 3.7500 1.1142 0.2695 4.0000 1.4498 0.0653 4.2500 0.9432 0.0927 4.5000 0.0000 0.0888 4.7500 -0.7984 0.0975 5.0000 -1.0388 0.1573 5.2500 -0.6758 0.0735 5.5000 0.0000 0.1147 5.7500 0.5721 0.0316 6.0000 0.7443 0.034
可以用gnuplot把数据画出来:
gnuplot> set title 'data visualization' gnuplot> plot 'test.dat'
默认只画前两列。可以使用下面的方法把第三列画出来 (把第三列当做误差):
plot 'test.dat' using 1:2:3 with yerrorbars
最后,可以使用save命令把执行的命令保存到文件里。以后,只要 执行 load命令,就会执行相应的命令了。
参考:
1. http://www.gnuplot.info/help.html
相关文章推荐
- 画图工具使用gnuplot&graphviz
- 使用GNUPLOT为cyclictest的测试结果画图以及gnuplot的脚本使用
- gnuplot画图程序的使用
- Gnuplot的使用
- Matlab中使用Plot函数动态画图方法总结
- NET简单的一个画图程序 使用简单 自己可以相关自己的内容进行配置就可以使用了
- 使用Graphics画图的小技巧
- [转载]Gnuplot使用技巧
- linux 下画图的工具 gnuplot
- gnuplot安装及使用
- 使用FrameBuffer画图和显示BMP图像的总结
- gnuplot基本使用(kelly)
- 使用画图类在画图时,想画一条竖线
- gnuplot使用笔记
- android画图-----shape的使用文档信息
- 使用WPF创建画图箭头
- Java中使用Graphics 画图的一个问题
- [转载]Gnuplot使用技巧
- gnuplot使用技巧(转载)
- Nagios使用pnp4画图