1. 进入gnuplot
>gnuplot
2. 进行需要作图的路径
cd "path"
3. 设置点线类型和别名:
plot "xx/aa.txt" title "titleName" with linespoints pointstype [1-20],
"xx/bb.txt" title "titleName" with linespoints pointstype [1-20]
4. 设置图形类别
a)柱状图:set style data histogram
画图时,直接 plot 'dataname.txt' u 2 t 2 ---取第二列数据画图
b)点线图:set style data linespoints
plot 'dataname.txt' u 2 t 2 ---取第二列数据画图
如果要画散点图可以:plot 'dataname.txt' using 2:3 ---以第二列为 x 的值,第三列为 y 的值
5. 设置图形的显示范围,即X,Y的范围
set yrange [0:300000]
set xrange [1:200]
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载