参考:
gnuplot demos
http://gnuplot.info/screenshots/index.html
一张图急速入门科研绘图 Gnuplot - 知乎
https://zhuanlan.zhihu.com/p/356438078
工作里用到了,记录一下。
实例1
python
# 在图形种添加箭头,指明起终点、lt是线条的类型,lw是线条宽度
set arrow from 1,1.11 to 22,1.11 nohead lt 4 lw 10
set arrow from 23,1.09 to 40,1.09 nohead lt 1 lw 40
set arrow from 41,1.07 to 46,1.07 nohead lt 3 lw 10
set arrow from 47,1.09 to 69,1.09 nohead lt 1 lw 40
set arrow from 70,1.11 to 78,1.11 nohead lt 4 lw 10
set arrow from 79,1.09 to 98,1.09 nohead lt 1 lw 40
set arrow from 99,1.07 to 225,1.07 nohead lt 3 lw 10
# 图例在图形下方
set key below
# title
set title "TMHMM posterior probabilities for check"
set yrange [0:1.2]
# 图形尺寸,表示绘图区域在 x 轴和 y 轴上的相对当前窗口的大小比例
set size 2., 1.4
#set xlabel "position"
set ylabel "probability"
set xrange [1:225]
# Make the ps plot
# 设置输出格式是postscript eps,字体是Hel* 字号30
# 也可以用 font ",30"
# 前面留空表示使用默认字体
set term postscript eps color solid "Helvetica" 30
# 设置输出的full path
set output "./TMHMM_125850/check.eps"
# 数据文件是check.plp,using指明了使用哪一列(1:4表示以第一列为x坐标,第四列为y坐标)
# title是数据列的标题,with是绘图方式,lt是线条的类型,lw是线条宽度
# 指定线条颜色:linecolor rgb 'red':改成 with impulses lt 1 lw 2 linecolor rgb 'red'
plot "./TMHMM_125850/check.plp" using 1:4 title "transmembrane" with impulses lt 1 lw 2, \
"" using 1:3 title "inside" with line lt 3 lw 2, \
"" using 1:5 title "outside" with line lt 4 lw 2
exit