dic= {
	5: \
		[0.0005273532080512637, \
		0.0016877931911526733, \
		0.00018686482977599977, \
		0.0005962772206420093, \
		0.00018686482977599977, \
		0.0019169138869584215, \
		0.0005970284360380938, \
		0.00018686482977599977,
		0.0005970284360380938, \
		0.0016616884561387398], \
	6: \
		[9.91604322831436e-05, \
		0.0012113348261861292, \
		0.0016062863206775136, \
		0.00013352853665400587, \
		0.0004580535877624758, \
		0.0008537562976499446, \
		0.0005346775581630867, \
		0.0005799382857771732, \
		0.00012188469801469734, \
		9.427753220859485e-05], \
	8: \
		[# 0.00045824139161149694, \
		9.690678609489032e-05, \
		8.845561288894059e-05, \
		8.920682828502501e-05, \
		8.826780903991949e-05, \
		9.859702073608028e-05, \
		8.582635900264512e-05, \
		8.88312205869828e-05, \
		9.033365137915164e-05, \
		8.86434167379617e-05], \
	7: \
		[8.958243598306722e-05, \
		8.563855515362401e-05, \
		9.296290526544713e-05, \
		8.808000519089838e-05, \
		8.901902443600392e-05, \
		9.54043553027215e-05, \
		8.714098594579286e-05, \
		9.127267062425717e-05, \
		9.18360821713205e-05, \
		8.657757439872954e-05], \
	9: \
		[0.00010460674390475565, \
		0.00010460674390475565, \
		9.57799630007637e-05, \
		9.634337454782702e-05, \
		9.95360399811858e-05, \
		0.00010498235160279787, \
		9.784580533999586e-05, \
		0.00010347992081062902, \
		9.878482458510138e-05, \
		9.690678609489032e-05], \
	10: \
		[0.00010648478239496669, \
		0.00010592137084790339, \
		9.57799630007637e-05, \
		9.634337454782702e-05, \
		0.00010066286307531244, \
		0.00010498235160279787, \
		9.859702073608028e-05, \
		0.00010554576314986117, \
		9.859702073608028e-05, \
		9.690678609489032e-05]
}

import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from pylab import *

x= dic.keys()
y= [np.mean(dic[elt]) for elt in x]
z= [np.std(dic[elt]) for elt in x]
fig = figure(figsize=(9, 6))
ax = fig.add_subplot(111)
ax.set_xlabel('Number of fixed-point digits of precision')
ax.set_ylabel('Logical fault rate in the inference mode')
ax.set_ylim([0.00005, 0.0015])
g= ax.plot(\
	x, y, color= 'g', marker='o', markersize=5, label= 'new', linestyle= 'None')
# ax.errorbar(\
	# x, y, yerr=z, color= 'g', linestyle='None', markersize=8, capsize=3)
ax.set_yscale('log')
for X, Y in zip(x, y):
    ax.annotate('{0:.2e}'.format(Y), \
    	xy=(X,Y), xytext=(25, -20), ha='right', textcoords='offset points')
ax.plot(x, [0.0001941891798878229]*6, linestyle= '--')
ax.annotate('Look-up table fault rate = %.2e' % (0.0001941891798878229), \
    xy=(5.5, 0.0001941891798878229), xytext=(120, -20), \
    ha= 'right', textcoords='offset points')
plt.show()