# Python macro and histogram with variable bin width

**URL:** <https://root-forum.cern.ch/t/python-macro-and-histogram-with-variable-bin-width/8417>\
**Category:** ROOT\
**Created:** [June 3, 2009, 10:13am UTC](https://root-forum.cern.ch/t/python-macro-and-histogram-with-variable-bin-width/8417 "2009-06-03T10:13:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [June 3, 2009, 6:04pm UTC](https://root-forum.cern.ch/t/python-macro-and-histogram-with-variable-bin-width/8417/2 "2009-06-03T18:04:19Z")

</div>

Angi,

the TH1::FillN() isn’t going to work with just two arguments, but to show how to pass a list through a double\* pointer:[code]from ROOT import \*  
from array import array

binLowE = [2,4,9,15,20,22]  
uniformTau = TH1D(“uniformTau”,"",5,array(‘d’,binLowE))  
#uniformTau.FillN(5,10)  
uniformTau.Draw()[/code]  
I.e. just use an array from module array. The buffer interface does the rest.

HTH,  
Wim

---

_[View the full topic](https://root-forum.cern.ch/t/python-macro-and-histogram-with-variable-bin-width/8417)._
