# Dividing 2 histograms

**URL:** <https://root-forum.cern.ch/t/dividing-2-histograms/51912>\
**Category:** Newbie\
**Created:** [October 10, 2022, 10:40am UTC](https://root-forum.cern.ch/t/dividing-2-histograms/51912 "2022-10-10T10:40:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roriana9](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@roriana9](https://root-forum.cern.ch/u/roriana9)\
**Post date:** [October 10, 2022, 10:40am UTC](https://root-forum.cern.ch/t/dividing-2-histograms/51912/1 "2022-10-10T10:40:13Z")

</div>

I am trying to divide 2 histograms by using  
TH1F _a = (TH1F_)h1-\>Clone();  
a-\>SetTitle(“h1/h2”);  
a-\>Divide(h2);  
a-\>Draw();  
but the result I got is almost flat, how can I change the distribution ?

 ![Screenshot 2022-10-10 at 11.38.26](https://root-forum.cern.ch/uploads/default/original/3X/d/4/d4c5d2904eaeaba6ad49e45d3a4532a8d386728e.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:** [October 10, 2022, 11:02am UTC](https://root-forum.cern.ch/t/dividing-2-histograms/51912/2 "2022-10-10T11:02:50Z")

</div>

> [@roriana9](#):
>
> but the result I got is almost flat, how can I change the distribution ?

Your histograms are very similar. So you get 1. . That’s correct.  
( x/x = 1 if x not equal to 0)
