# Horizontal line through zero bin content

**URL:** <https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385>\
**Category:** Newbie\
**Tags:** root\
**Created:** [December 4, 2023, 11:56am UTC](https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385 "2023-12-04T11:56:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [December 4, 2023, 11:56am UTC](https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385/1 "2023-12-04T11:56:25Z")

</div>

Hi Everyone,

I am trying to plot two 1D histograms on the  
same canvas with non-zero bin contents from 0 to 0.7. However, the histograms produced also draw a line over zero bin contents. Is it possible to get rid of this line?

 ![histogram_0line](https://root-forum.cern.ch/uploads/default/original/3X/d/b/dbe6f9bf99cc0cfddfc38fed046003fdd67428fb.png)

I went through the [old post](https://root-forum.cern.ch/t/how-to-stop-drawing-lines-on-histo-bins-with-zero-content/4160/4) by @couet answering a similar question however the SetMinmum(0) option seems to have no effect. Can someone please help me determine where I am making a mistake or how to remove this line?

Thanks a lot for your time and consideration!

Edit1: I think the SetMinium(0) histogram seems to work. However, there is an issue when I plot another histogram on the same canvas

```auto
h8->SetMinimum(0)
h8->Draw()

```

 ![h8](https://root-forum.cern.ch/uploads/default/original/3X/e/5/e533d84a258f7ccb434fbb939afbf683615f7f3f.png)

```auto
h9->SetMinimum(0)
h9->Draw()

```

 ![h9](https://root-forum.cern.ch/uploads/default/original/3X/a/9/a98ad865fb3adb47fd8cf634560bb70fe74aa754.png)

```auto
h8->Draw("same")

```

 ![h8_plus_h9](https://root-forum.cern.ch/uploads/default/original/3X/3/1/315d81b53518593e3bbf7f1f213d9b5118fc1743.png)

---

<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:** [December 4, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385/2 "2023-12-04T12:07:24Z")

</div>

What I see on your plot is not “a line at 0” but the bins after the high peaks having 0 as content. That’s the “red line” overwriting the axis . You need to redraw the axis with:

```auto
gPad->RedrawAxis();

```

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [December 4, 2023, 12:15pm UTC](https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385/3 "2023-12-04T12:15:48Z")

</div>

Thanks a lot for your prompt reply and accurate solution !

By the way, is the `Redraw()` axis option something we shall do always while plotting multiple graphs ?

---

<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:** [December 4, 2023, 12:22pm UTC](https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385/4 "2023-12-04T12:22:33Z")

</div>

It depends what users want. Sometimes one want to see the bin drawn even if it is on the axis. That’s why we cannot make it automatic by default…

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [December 4, 2023, 12:30pm UTC](https://root-forum.cern.ch/t/horizontal-line-through-zero-bin-content/57385/5 "2023-12-04T12:30:14Z")

</div>

Yes, that’s quite reasonable
