import sys from numpy import loadtxt # pandas read.csv seems to the most elegant method, but this is a simple ascii file reader import matplotlib.pyplot as plt if (len(sys.argv) > 1): infile = sys.argv[1] x,y = loadtxt(infile,unpack=True,usecols=(0,1)) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x,y) # could stop here, but can pretty it up a little xspan = max(x) -min(x) yspan = max(y) -min(y) minx = min(x) - 0.05*xspan maxx = max(x) + 0.05*xspan miny = min(y) - 0.05*yspan maxy = max(y) + 0.05*yspan ax.axis([minx,maxx,miny,maxy]) if (len(sys.argv) > 2) : ax.set_title(sys.argv[2]) plt.show() else: print("Syntax: xyploter [title]")