Skip to content
Snippets Groups Projects
Commit dfb4b3bd authored by Annika Vauth's avatar Annika Vauth
Browse files

different way to plot the result in the example code

parent 3cb047fa
No related branches found
No related tags found
1 merge request!1Suppress warning about ndarray from ragged nested sequences
from LightSimtastic import SiPMSimulation from LightSimtastic import SiPMSimulation
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np
################################# #################################
# THE SIMULATION TOOL TAKES A DICTIONARY AS AN INPUT, WITH EACH OF THE VARIABLES AS KEYS. # THE SIMULATION TOOL TAKES A DICTIONARY AS AN INPUT, WITH EACH OF THE VARIABLES AS KEYS.
...@@ -80,14 +80,14 @@ Qs = df.iloc[0]["ChargeSpectrum"] ...@@ -80,14 +80,14 @@ Qs = df.iloc[0]["ChargeSpectrum"]
# PLOT # PLOT
################################# #################################
plt.figure(figsize=(15.5,10.5)) plt.figure(figsize=(15.5,10.5))
plt.hist(Qs, label="Simulated Charge Spectrum", bins=1000) H, edges = np.histogram(Qs, bins=1000)
edges = edges[:-1]+(edges[1]-edges[0])
plt.plot(edges, H)
plt.title("Simulated Charge Spectrum")
plt.yscale("log") plt.yscale("log")
plt.xticks(fontsize=25) plt.xticks(fontsize=25)
plt.yticks(fontsize=25) plt.yticks(fontsize=25)
plt.xlabel("# GD", fontsize=25), plt.xlabel("# GD", fontsize=25),
plt.savefig("./Example.png") plt.savefig("./Example.png")
plt.legend(fontsize=25)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment