import numpy as np import matplotlib.pyplot as plt import sys if (not len(sys.argv) == 2): print("Please give the data file as the only argument for this program") sys.exit() file_name = sys.argv[1] data = np.loadtxt(file_name, delimiter = " ") plt.figure() plt.plot(data[:,0], data[:,1], '-bo') if (np.shape(data)[1] == 3): plt.plot(data[:,0], data[:,1]/data[:,2]*100.0, '-r', linewidth=2) plt.legend(['Series','Analytical value'], loc = 4) plt.grid() plt.xlabel("i") plt.ylabel("value") plt.show()