diff --git a/Example.py b/Example.py index 36621728347ebff3459d791b1c1fe14cb9c700ba..69f0d7ca4f5ded82f809c259eeaa8b3b6952c384 100644 --- a/Example.py +++ b/Example.py @@ -1,6 +1,6 @@ from LightSimtastic import SiPMSimulation 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. @@ -80,14 +80,14 @@ Qs = df.iloc[0]["ChargeSpectrum"] # PLOT ################################# - - 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.xticks(fontsize=25) plt.yticks(fontsize=25) plt.xlabel("# GD", fontsize=25), plt.savefig("./Example.png") -plt.legend(fontsize=25) diff --git a/LightSimtastic.py b/LightSimtastic.py index ff58b539c3055fa426c61146f0165734f143a15b..c09d042a8136e452a3d0e5cf0e3dabc6f6bef2cd 100644 --- a/LightSimtastic.py +++ b/LightSimtastic.py @@ -21,7 +21,10 @@ from copy import deepcopy np.set_printoptions(suppress=True) - +# evil but works: just suppress the numpy nested ragged array warning +import warnings +warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) + class SiPMSimulation: