# How can i plot a graph beteen mean values which i will take from histograms and values inserted manually

**URL:** <https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484>\
**Category:** Newbie\
**Created:** [November 1, 2021, 11:14am UTC](https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484 "2021-11-01T11:14:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Towseef\_Rehman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/e495f1/32.png) [@Towseef\_Rehman](https://root-forum.cern.ch/u/Towseef_Rehman)\
**Post date:** [November 1, 2021, 11:14am UTC](https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484/1 "2021-11-01T11:14:17Z")

</div>

I have many root fils each with a number of histograms. from these histograms, I want to take mean values and plot them against some constant values. can I use the GetMean() function inside the graph? if possible please help me.  
any help is highly appreciated.

\_ROOT Version: 6.16/00es  
_Platform:_ linuxx8664gcc

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [November 1, 2021, 11:43am UTC](https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484/2 "2021-11-01T11:43:46Z")

</div>

I think so, see [TH1::GetMean()](https://root.cern.ch/doc/master/classTH1.html#a3e2fa7eca22330a7f6458e481e6ca0ae)

---

<div class="post-metadata">

**Author:** ![Towseef\_Rehman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/e495f1/32.png) [@Towseef\_Rehman](https://root-forum.cern.ch/u/Towseef_Rehman)\
**Post date:** [November 2, 2021, 6:20am UTC](https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484/3 "2021-11-02T06:20:34Z")

</div>

I couldn’t understand, I mean inside getmean function do I need to write the histograms?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [November 2, 2021, 8:09am UTC](https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484/4 "2021-11-02T08:09:47Z")

</div>

If I understand correctly, you have to loop over your histograms, call `GetMean()` for each of them, and fill another histogram with each value. Is that what you asked for?

---

<div class="post-metadata">

**Author:** ![Towseef\_Rehman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/e495f1/32.png) [@Towseef\_Rehman](https://root-forum.cern.ch/u/Towseef_Rehman)\
**Post date:** [November 2, 2021, 8:18am UTC](https://root-forum.cern.ch/t/how-can-i-plot-a-graph-beteen-mean-values-which-i-will-take-from-histograms-and-values-inserted-manually/47484/5 "2021-11-02T08:18:28Z")

</div>

Yes, Thankyou i got it now
