import matplotlib.pyplot as pltimport numpy as npdef readfile(filename): dataList = [] dataNum = 0 with open(filename,'r') as f: for line in f.readlines(): linestr = line.strip('/n') if len(linestr) < 8 and len(linestr) >1: dataList.append(float(linestr)) dataNum += 1 return dataList, dataNum y, range = readfile("./session.log") # print yprint "range=%d" % (range) x = np.linspace(0, 1, range)# plt.plot(x, y, 'r-o')plt.plot(x, y)plt.show()