import numpy
import matplotlib.pyplot as plt

infile = "./t3p_results/OUTPUT/inputPower.out"
print( 'infile: {}'.format(infile) )

A = numpy.loadtxt(infile, skiprows=0)
x = A[:,0]*1.e9
y = A[:,1]

infile = "./t3p_results/OUTPUT/outputPower.out"
print( 'infile: {}'.format(infile) )

A = numpy.loadtxt(infile, skiprows=0)
x1 = A[:,0]*1.e9
y1 = A[:,1]

fig = plt.figure()
axes = plt.gca()
plt.plot(x,y,'b',x1,y1,'r--')
plt.xlabel('Time [ns]')
plt.ylabel('Power [Arbitrary units]')
plt.legend(['Input','Output'])
plt.show()

fig.savefig('power.png')

plt.close()
