add new function in packdataforplot.sh