#!/usr/bin/env python import pylab from pylab import * from matplotlib import * import numpy as np # Inputs infile = 'test.dat' outfile = 'fig1.png' # Read data, put into arrays time and flux a = np.loadtxt(infile) time = []; flux = [] time = array(a[:,0]) flux = array(a[:,1]) ptime = time - 55000 # convert to BJD #xmin = ptime.min() # These aren't used, but you might use them #xmax = ptime.max() #ymin = flux.min() #ymax = flux.max() #xr = xmax - xmin #yr = ymax - ymin # set plot parameters xlab = "BJD-2455000" ylab = 'Counts' #pylab.figure(1,figsize=[8,6]) #pylab.axes([0.06,0.113,0.93,0.88]) pylab.xlabel(xlab) pylab.ylabel(ylab) pylab.plot(ptime,flux,',') pylab.savefig(outfile,dpi=100) show()