In [1]:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib notebook
In [2]:
# Mass number (A), number of protons, name of isotope, mass [MeV/c^2],
# binding energy [MeV] and binding energy per nucleus [MeV]
# for different atomic nuclei
data = pd.read_csv('binding_energy.txt', skiprows=11, sep=' ',
names=['Mass Number', 'Number of Protons', 'name of isotope',
'mass', 'binding energy', 'binding energy per nucleus' ])
Emean_vs_A = data.groupby('Mass Number')['binding energy per nucleus'].mean()
mass_vs_A = data.groupby('Mass Number')['mass'].mean()
In [3]:
ax = Emean_vs_A.plot(x='Mass Number', y='binding energy per nucleus',
legend=False, color=(0.3,0.3,0.3,0.5), marker='o', alpha=0.7)
ax.set_xlabel('Mass number A (number of nucleons)', fontsize=16)
ax.set_ylabel('Average binding energy per nucleons [MeV]', fontsize=16)
ax.grid(True)
ax.tick_params(size=14)
plt.tight_layout()
In [4]:
ax2 = data.plot(x='Mass Number', y='binding energy per nucleus',
legend=False, kind='scatter', color=(0.8,0.8,0.8,1))
ax2.set_xlabel('Mass number A (number of nucleons)', fontsize=16)
ax2.set_ylabel('Binding energy per nucleons [MeV]', fontsize=16)
ax2.grid(True)
ax2.tick_params(size=14)
ax2.set_xlim(0,260)
ax2.set_ylim(0, 9)
plt.tight_layout()
In [ ]: