最近帮博士后学姐做实验画图,图需要嵌入Latex,故使用GnuPlot做矢量图(eps),留下记录。
基础学习:
请参考:http://www.cnblogs.com/aioria0622/archive/2008/09/14/1290776.html
实例一:
需要做的图:
使用的技巧主要有:
1.同时画多条线;2.载入数据作图;3.不同线型选择;4输出为eps和jpg;set key left #设置图例位置
set xlabel "dimensions" #设置坐标轴名称
set ylabel "time(sec)"
set logscale y #设计坐标为对竖坐标
# 设置输出为jpg 方便预览
set term jpeg
set out "f8.jpg"
filename = 'f8.txt' #载入数据文件
plot filename using 1:2 with linespoints pt 1 title 'SFS',filename using 1:3 with linespoints pt 2 title "RPS",filename using 1:4 with linespoints pt 3 title "APS",filen