Skip to content

Commit

Permalink
logscale + density plot
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Nov 27, 2024
1 parent 6e86fbf commit fbfd224
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/plot_energy_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@
)

# Plot the source energy distribution
energies = my_source[0].energy.sample(n_samples=100000)
energies = my_source[0].energy.sample(n_samples=int(5e6))

plt.hist(
data, bins, _ = plt.hist(
energies / 1e6,
bins=1000,
histtype="step",
label=f"{1-tritium_fraction:.0%} D - {tritium_fraction:.0%} T",
density=True,
# alpha=0.5,
)

plt.xlabel("Energy (MeV)")
plt.ylabel("Number of neutrons")
plt.ylabel("Neturon energy distribution")
plt.yscale("log")
plt.legend()
plt.show()

0 comments on commit fbfd224

Please sign in to comment.