# Modifying the interval on the logarithmic scale

**URL:** <https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208>\
**Category:** ROOT\
**Created:** [August 12, 2018, 4:02pm UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208 "2018-08-12T16:02:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.elison](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/8dc957/32.png) [@s.elison](https://root-forum.cern.ch/u/s.elison)\
**Post date:** [August 12, 2018, 4:02pm UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208/1 "2018-08-12T16:02:45Z")

</div>

* * *

_ROOT Version:_ 5.34/30  
_Platform:_ Ubuntu 16.04LTS

* * *

Hi everyone,

I was drawing several histograms on ROOT, all of than with Y log scale. But one of than came with a different kind o scale. I just wanna to set it like the others.

This is the different one:  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/6/9/693ef5921a242149a22b149f7a4be7e0b6cc590c.png)

I want to set it like:  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/7/a/7a6ce00963dd8325ad7b9b6acc921b054d80b7f2.png)

Can anybody help me?

Thanks!

---

<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:** [August 13, 2018, 9:20am UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208/2 "2018-08-13T09:20:25Z")

</div>

0 is invalid in case of log scale. Some improvements were done after 5:34. Try to define a minimum positive (an epsilon).

---

<div class="post-metadata">

**Author:** ![s.elison](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/8dc957/32.png) [@s.elison](https://root-forum.cern.ch/u/s.elison)\
**Post date:** [August 13, 2018, 3:58pm UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208/3 "2018-08-13T15:58:25Z")

</div>

Hi @couet, thanks for the answer

Actually that zero is from the X axis. The first one have not a cut along the axis, the second in 20 (this is the reason the second image do not shows the 20, one time it goes from 50 to 50). ROOT just adjusted the scale automatic and i want all to be the same.

I tried to use  
“hs-\>GetYaxis()-\>SetLimits(1, pow(10,4));”  
where hs is the stack histogram, but it did not work for Y, only for X.

My code are attached  
[met\_transposition.cpp](https://root-forum.cern.ch/uploads/default/original/3X/d/f/df1483c7e3c9e9d7c99c00f5480336531021057c.cpp) (2.4 KB)

---

<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:** [August 13, 2018, 5:17pm UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208/4 "2018-08-13T17:17:04Z")

</div>

[`hs->SetMinimum(1.); hs->SetMaximum(1.e4);`](https://root-forum.cern.ch/t/how-to-set-ranges-on-axis/28254)

---

<div class="post-metadata">

**Author:** ![s.elison](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/8dc957/32.png) [@s.elison](https://root-forum.cern.ch/u/s.elison)\
**Post date:** [August 13, 2018, 5:33pm UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208/5 "2018-08-13T17:33:24Z")

</div>

It worked! Thanks @Wile_E_Coyote

---

<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:** [August 27, 2018, 5:33pm UTC](https://root-forum.cern.ch/t/modifying-the-interval-on-the-logarithmic-scale/30208/6 "2018-08-27T17:33:29Z")

</div>

Closed on August 27, 2018, 5:33pm UTC

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