Giù Marcer
093faf3fe8
move all the functions to lib.c and lib.h; add this two librearies to makefile; make plot.py more easy to use for passing to one mode to the other (show or save figure); create fit_plot and create the figure 5-fit.pdf.
32 lines
705 B
Python
Executable File
32 lines
705 B
Python
Executable File
#!/usr/bin/env python
|
||
|
||
import matplotlib.pyplot as plt
|
||
import numpy as np
|
||
import sys
|
||
|
||
|
||
table = np.loadtxt(sys.stdin, unpack=True, skiprows=2, delimiter='|')
|
||
calls, I_MC, σ_MC, I_MI, σ_MI, I_VE, σ_VE, chi = table
|
||
exact = 1.7182818285
|
||
|
||
plt.figure()
|
||
# plt.figure(figsize=(5, 3))
|
||
# plt.rcParams['font.size'] = 8
|
||
|
||
plt.title('Integral uncertainty', loc='right')
|
||
plt.ylabel('$\sigma_I$')
|
||
plt.xlabel('calls')
|
||
plt.xscale('log')
|
||
plt.yscale('log')
|
||
|
||
plt.plot(calls, σ_MC, linestyle='', marker='o',
|
||
color='#92182b', label='$\sigma_I$')
|
||
x = np.logspace(1, 8, 5)
|
||
a = 0.48734
|
||
b = -0.49938
|
||
plt.plot(x, a*(x**b), color='gray')
|
||
|
||
plt.tight_layout()
|
||
# plt.savefig('notes/images/5-fit.pdf')
|
||
plt.show()
|