您的位置:首页 > 其它

gnuplot画图

2016-10-12 10:14 513 查看
常用的一些属性:

linestyle 连线风格(包括linetype,linewidth等) linetype 连线种类

linewidth 连线粗细

linecolor 连线颜色

pointtype 点的种类 pointsize 点的大小

画柱状图:

set terminal png
set output 'data.png'
set style data histogram
set style histogram clustered gap 1
set style fill pattern 3 border -1

plot "data"  using 2:xticlabels(1) title columnheader(2), '' using 3:xticlabels(1) title columnheader(3), '' using 4:xticlabels(1) title columnheader(4), '' using 5:xticlabels(1) title columnheader(5),'' using 6:xticlabels(1) title columnheader(6), '' using 7:xticlabels(1) title columnheader(7), '' using 8:xticlabels(1) title columnheader(8)


画折线图 且用log形式表示纵坐标:

使用简写 w=with pt=pattern lp=linepoints u=using

set terminal postscript eps color solid linewidth 2 "Helvetica" 20
set output 'data.eps'
set logscale y
set yrange [0.0001:1000]
set ytics ("0.0001" 0.0001,"0.01" 0.01,"1" 1,"100" 100,"500" 500)
plot "data"  using 2:xticlabels(1) w lp title columnheader(2) pt 7, '' using 3:xticlabels(1) w lp title columnheader(3) pt 5, '' using 4:xticlabels(1) w lp title columnheader(4), '' using 5:xticlabels(1) w lp title columnheader(5),'' using 6:xticlabels(1) w lp title columnheader(6), '' using 7:xticlabels(1) w lp title columnheader(7), '' using 8:xticlabels(1) w lp title columnheader(8)


很有用的文档:http://www.phy.fju.edu.tw/files/archive/876_ab57aed9.pdf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  plot