aboutsummaryrefslogtreecommitdiff
path: root/utils/plot-energy
diff options
context:
space:
mode:
Diffstat (limited to 'utils/plot-energy')
-rwxr-xr-xutils/plot-energy7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/plot-energy b/utils/plot-energy
index 4568bcc..2fb2aa1 100755
--- a/utils/plot-energy
+++ b/utils/plot-energy
@@ -31,7 +31,7 @@ from scipy.stats import iqr, poisson
from matplotlib.lines import Line2D
from scipy.stats import iqr, norm, beta
from scipy.special import spence
-from itertools import izip_longest
+from itertools import chain
particle_id = {20: 'e', 22: r'\mu'}
@@ -56,6 +56,11 @@ def plot_hist2(df, muons=False):
plt.hist(df_id.ke.values, bins=bins, histtype='step')
plt.gca().set_xscale("log")
plt.xlabel("Energy (MeV)")
+ major = np.array([10,100,1000,10000])
+ minor = np.unique(list(chain(*list(range(i,i*10,i) for i in major[:-1]))))
+ minor = np.setdiff1d(minor,major)
+ plt.gca().set_xticks(major)
+ plt.gca().set_xticks(minor,minor=True)
plt.title('$' + ''.join([particle_id[int(''.join(x))] for x in grouper(str(id),2)]) + '$')
if len(df):