#!/bin/bash
# usage ./gen-graph.sh <PATH>
# NOTE: the best way is to use this scripe in .txt files' PATH.
# all .txt files are treated as histogram
datafile=($(find $1 -name "*.txt"))
echo "set term post eps color solid enh" > graph.cmd
for(( i=0;i<${#datafile[@]};i++)) do
echo "set output \"${datafile[i]}.eps\"" >> graph.cmd
echo "plot for [i=1:10] \"${datafile[i]}\" using 1:i+1 title \"thread\".i with lines" >> graph.cmd
done
gnuplot graph.cmd
#epsfile=($(find . -name "*.eps"))
#for(( i=0;i<${#epsfile[@]};i++)) do
# convert ${epsfile[i]} $(basename ${epsfile[i]} .txt.eps).png
#done
gnuplot生成cyclictest histogram图
最新推荐文章于 2024-02-02 20:08:21 发布
本文介绍了一个bash脚本,它遍历指定目录下的所有.txt文件,将它们转换为EPS格式,并使用Gnuplot绘制柱状图。脚本通过`find`命令查找文件,然后逐个调用Gnuplot生成线图,每张图对应一个文件的数据。
摘要由CSDN通过智能技术生成