# After energy calibration, some histogram bins are empty

**URL:** <https://root-forum.cern.ch/t/after-energy-calibration-some-histogram-bins-are-empty/53539>\
**Category:** Newbie\
**Created:** [February 8, 2023, 9:19pm UTC](https://root-forum.cern.ch/t/after-energy-calibration-some-histogram-bins-are-empty/53539 "2023-02-08T21:19:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 9, 2023, 9:31am UTC](https://root-forum.cern.ch/t/after-energy-calibration-some-histogram-bins-are-empty/53539/4 "2023-02-09T09:31:21Z")

</div>

A better idea is to “calibrate” the original histogram:

```python
a = z[0]; b = z[1] # En = a * Ch + b ("channel to energy" calibration)
ax = h.GetXaxis() # an axis with fix bins (will be scaled with a linear function)
ax.Set(ax.GetNbins(), a * ax.GetXmin() + b, a * ax.GetXmax() + b)
h.ResetStats()

```

---

_[View the full topic](https://root-forum.cern.ch/t/after-energy-calibration-some-histogram-bins-are-empty/53539)._
