-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScatteringPlot.py
34 lines (29 loc) · 912 Bytes
/
ScatteringPlot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
params = {
'xtick.labelsize': 17,
'ytick.labelsize': 17,
'axes.titlesize' : 18,
'axes.labelsize' : 18,
'legend.fontsize': 16
}
pylab.rcParams.update(params) # Aplicar los cambios
# Load potential values
data = np.loadtxt('Elastic_plot_ratio_ruth.txt', skiprows=2)
theta = data[:, 0]
ruth_cross = data[:, 1]
data_exp = np.loadtxt("sigma_ratio_output.txt", skiprows = 1)
theta0 = data_exp[:, 0]
ruth_cross0 = data_exp[:, 1]
# Plot the potentials
plt.figure(figsize=(10, 6))
plt.plot(theta, ruth_cross, color = "black", label = "Theorical data")
plt.plot(theta0, ruth_cross0, linestyle ="--", color = "red", label = "Experimental data")
# Customize plot
plt.xlabel(r"$\theta$ (deg)")
plt.ylabel(r"$\sigma/\sigma_r$")
plt.legend()
plt.semilogy()
plt.savefig('ElasticScattering.pdf')
plt.close()