Linux系统使用gnuplot绘图
1、在Linux系统中,通过源码安装gnuplot
2、打开终端,输入gnuplot命令
3、绘图:
1> gnuplot> plot sin(x)
2> gnuplot> plot "datafile.dat" with lines
3> gnuplot> load "gnu.gnu"
#cat animate.gnu:
set term gif animate delay 10
set output "animate.gif"
set samples 1000
set xrange [0:4*pi]
unset key
set tics textcolor rgb "orange"
set border lc rgb "orange"
set grid lc rgb "orange"
i=0
load "looper.gnu"
set output
#cat looper.gnu
set object 1 rectangle from screen 0,0 to screen 1,1 fc rgb "gray10" behind
plot sin(x+i*pi/20) lw 3 lc rgb "green" notitle
i=i+1
if (i<40) reread
4> reread -- 绘制动画图片
让 gnuplot 返回到脚本文件最开始的地方,为了形成有效的循环(而不是死循环),reread 命令需要配合 if 条件判别式
5> 设置标题、横纵坐标
gnuplot> set term wxt enhanced
gnuplot> set x labe l "X"
gnuplot> set y labe l "Y"
gnuplot> set xrange [ 0 : 1 0 ]
gnuplot> set xt i cs 0 ,1 ,10
gnuplot> un se t key
gnuplot> set t i t l e "0阶贝塞尔函数 J_0 ( x )"
gnuplot> p lot besj0 ( x )
6> gnuplot> test
查看绘图线条属性