fig = plt.figure(figsize=(12,8))
ax = fig.add_subplot(111)
for tube in tubeList:
fileName = "tube_%s.csv" % (tube)
print fileName
myArray = np.genfromtxt(fileName, delimiter=',', comments='#')
myArray = np.sort(myArray,0)
volts = myArray[:,0]
dVolts = myArray[:,1]
countTimes = myArray[:,2]
counts = myArray[:,3]
CPM = counts / countTimes
dCPM = np.sqrt(counts) / countTimes
ax.errorbar(volts, CPM, xerr=dVolts, yerr=dCPM, fmt='-o', label=tube)
ax.set_title("SI22G Geiger Tube Response")
ax.set_xlabel("Voltage (V)")
ax.set_ylabel("CPM")
ax.set_xlim(200,450)
ax.set_ylim(0,10000)
ax.legend()
ax.grid()
fig.savefig("GeigerTubes.svg")