# ROOT 6.32.00: ulast \> fXmax, fXmax is used message

**URL:** <https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573>\
**Category:** ROOT\
**Created:** [June 6, 2024, 4:16pm UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573 "2024-06-06T16:16:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeWhoo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/e8c25b/32.png) [@LeWhoo](https://root-forum.cern.ch/u/LeWhoo)\
**Post date:** [June 6, 2024, 4:16pm UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/1 "2024-06-06T16:16:16Z")

</div>

Dear All,

I have a program that displays a 2D histogram with some margins:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/1/6/16fc6689965242b63b4cd66d2a0df417a5668ff5.png)

To achieve that, I do:

```auto
pdm.GetXaxis().SetRangeUser(-1, self.ExpTree.MaxHistoPixelX+1)

```

and the same on Y. On the most recent ROOT, I started to get warnings:

```auto
TAxis::TAxis::SetRangeUser:0: RuntimeWarning: ufirst < fXmin, fXmin is used
TAxis::TAxis::SetRangeUser:0: RuntimeWarning: ulast > fXmax, fXmax is used
TAxis::TAxis::SetRangeUser:0: RuntimeWarning: ufirst < fXmin, fXmin is used
TAxis::TAxis::SetRangeUser:0: RuntimeWarning: ulast > fXmax, fXmax is used

```

The first point is, that new ROOT versions will not force me to create a bigger histogram with an empty border, because that will complicate the histogram filling (bin by bin and replacing its underlying array) significantly and make it bug prone.

Second, I think that the warning is… not telling the truth, because the margins are there 🙂

How should I proceed?

* * *

_ROOT Version:_ 6.32.02  
_Platform:_ Fedora 40  
_Compiler:_ linuxx8664gcc

* * *

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [June 7, 2024, 4:51am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/2 "2024-06-07T04:51:33Z")

</div>

Hi,

I am sorry you are experiencing this behaviour. I add in the loop @couet .

Cheers,  
D

---

<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:** [June 10, 2024, 7:50am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/3 "2024-06-10T07:50:03Z")

</div>

Can you provide a small script reproducing this issue ?

---

<div class="post-metadata">

**Author:** ![LeWhoo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/e8c25b/32.png) [@LeWhoo](https://root-forum.cern.ch/u/LeWhoo)\
**Post date:** [June 10, 2024, 9:06am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/4 "2024-06-10T09:06:47Z")

</div>

```auto
auto h = new TH2D("h", "h", 2, 0, 2, 2, 0, 2)
h->GetXaxis()->SetRangeUser(-1, 3)
h->Draw("colz")

```

---

<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:** [June 10, 2024, 10:14am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/5 "2024-06-10T10:14:52Z")

</div>

I see. With SetRange or SetRangeUser, you generally cannot define larger ranges than the initial ones. @moneta can confirm this.

---

<div class="post-metadata">

**Author:** ![LeWhoo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/e8c25b/32.png) [@LeWhoo](https://root-forum.cern.ch/u/LeWhoo)\
**Post date:** [June 10, 2024, 10:51am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/6 "2024-06-10T10:51:51Z")

</div>

I thought so, but it works. It seems like a bug was an important functionality for me, and the bug (that I actually can define larger ranges, and it works; it just complains) still exists. Would it be possible to keep it or add some functions to do what I am doing—adding “margins” to the histogram inside the histogram frame?

For now I can filter the warning in Python, but I am afraid you will fix the bug (first time in my long history of using ROOT I am afraid of that 🙂 ).

---

<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:** [June 10, 2024, 11:10am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/7 "2024-06-10T11:10:11Z")

</div>

I am not sure it is working when you [see the SetRange code](https://root.cern/doc/v632/TAxis_8cxx_source.html#l01052).  
@moneta can tell more on that.

---

<div class="post-metadata">

**Author:** ![LeWhoo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/e8c25b/32.png) [@LeWhoo](https://root-forum.cern.ch/u/LeWhoo)\
**Post date:** [June 18, 2024, 7:22am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/8 "2024-06-18T07:22:51Z")

</div>

Hello,

Any update on that issue?

---

<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:** [June 18, 2024, 9:17am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/9 "2024-06-18T09:17:34Z")

</div>

@moneta is the expert for this part of the code.

---

<div class="post-metadata">

**Author:** ![LeWhoo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/e8c25b/32.png) [@LeWhoo](https://root-forum.cern.ch/u/LeWhoo)\
**Post date:** [July 1, 2024, 11:55am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/10 "2024-07-01T11:55:15Z")

</div>

Trying to keep this topic alive.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 15, 2024, 11:55am UTC](https://root-forum.cern.ch/t/root-6-32-00-ulast-fxmax-fxmax-is-used-message/59573/11 "2024-07-15T11:55:48Z")

</div>

Closed on July 15, 2024, 11:55am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
