diff --git a/python/examples/shower_profile.py b/python/examples/shower_profile.py
index 93e2009493bfe372d8b4700a8ced9d8b3a1386e6..8cd03cab863698c32f6b5071d970bd965c7c874e 100644
--- a/python/examples/shower_profile.py
+++ b/python/examples/shower_profile.py
@@ -32,7 +32,9 @@ def plot_avg_profile(dat, part, ax):
     nshower = len(dat.shower.unique())  # number of showers in output dir
     max_dX = np.max(dat["X"])
     h = np.histogram(
-        dat.X, bins=np.linspace(0, max_dX, 200), weights=dat[part] * 1 / float(nshower)
+        dat.X, 
+        bins=np.linspace(0, max_dX, len(dat["X"]) - 1), 
+        weights=dat[part] * 1 / float(nshower),
     )
     ax.plot(h[1][:-1], h[0], label=part)