ex-4: redo images with right size and fontsize
This commit is contained in:
parent
8d88da3c1f
commit
4561e8943f
23
ex-4/plot.py
23
ex-4/plot.py
@ -5,6 +5,11 @@ import numpy as np
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def f(x, p_max):
|
||||||
|
return x * np.log(p_max/x)/np.arctan(np.sqrt(p_max**2/x**2 - 1))
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
bins = input()
|
bins = input()
|
||||||
step = input()
|
step = input()
|
||||||
bins = int(bins.split("\t")[1])
|
bins = int(bins.split("\t")[1])
|
||||||
@ -12,12 +17,26 @@ step = float(step.split("\t")[1])
|
|||||||
counts = np.loadtxt(sys.stdin)
|
counts = np.loadtxt(sys.stdin)
|
||||||
edges = np.linspace(0, bins*step, bins+1)
|
edges = np.linspace(0, bins*step, bins+1)
|
||||||
|
|
||||||
plt.rcParams['font.size'] = 17
|
plt.figure()
|
||||||
|
# plt.figure(figsize=(5, 3))
|
||||||
|
# plt.rcParams['font.size'] = 8
|
||||||
|
|
||||||
plt.hist(edges[:-1], edges, weights=counts,
|
plt.hist(edges[:-1], edges, weights=counts,
|
||||||
histtype='stepfilled', color='#e3c5ca', edgecolor='#92182b')
|
histtype='stepfilled', color='#e3c5ca', edgecolor='#92182b')
|
||||||
plt.title('Vertical component distribution', loc='right')
|
|
||||||
|
plt.title('Simulation', loc='right')
|
||||||
plt.xlabel(r'$p_h$')
|
plt.xlabel(r'$p_h$')
|
||||||
plt.ylabel(r'$\left<|p_v|\right>$')
|
plt.ylabel(r'$\left<|p_v|\right>$')
|
||||||
|
|
||||||
|
# x = np.arange(0, 10, 0.001)
|
||||||
|
# y = f(x, 10)
|
||||||
|
# plt.plot(x, y, c='#92182b', linewidth=2)
|
||||||
|
|
||||||
|
plt.tight_layout()
|
||||||
plt.show()
|
plt.show()
|
||||||
|
# plt.savefig('notes/images/4-fit.pdf')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user