added data analysis function for plotting several files