# Problem constructing TH2F

**URL:** <https://root-forum.cern.ch/t/problem-constructing-th2f/8895>\
**Category:** ROOT\
**Created:** [September 2, 2009, 1:07pm UTC](https://root-forum.cern.ch/t/problem-constructing-th2f/8895 "2009-09-02T13:07:55Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 2, 2009, 3:19pm UTC](https://root-forum.cern.ch/t/problem-constructing-th2f/8895/6 "2009-09-02T15:19:17Z")

</div>

(Number of bins = array\_dimension) gives:

```auto
root [0] Double_t b_f[9]={0.,0.1,0.16,0.2,0.25,0.3,0.35,0.4,0.6};
root [1] TH2F*h=new TH2F("a","a",10,0,1,9,b_f)
Error in <TAxis::TAxis::Set>: bins must be in increasing order
root [2]
```

(Number of bins = array\_dimension-1) gives:

```auto
root [0] Double_t b_f[9]={0.,0.1,0.16,0.2,0.25,0.3,0.35,0.4,0.6};
root [1] TH2F*h=new TH2F("a","a",10,0,1,8,b_f)
root [2]
```

That’s logic, the array defines the bins’ boundaries.

---

_[View the full topic](https://root-forum.cern.ch/t/problem-constructing-th2f/8895)._
