# Saving TH1 histograms in root file with embeded texgt

**URL:** <https://root-forum.cern.ch/t/saving-th1-histograms-in-root-file-with-embeded-texgt/45474>\
**Category:** Newbie\
**Created:** [June 19, 2021, 11:06pm UTC](https://root-forum.cern.ch/t/saving-th1-histograms-in-root-file-with-embeded-texgt/45474 "2021-06-19T23:06:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [June 19, 2021, 11:06pm UTC](https://root-forum.cern.ch/t/saving-th1-histograms-in-root-file-with-embeded-texgt/45474/1 "2021-06-19T23:06:29Z")

</div>

Dear Rooters,

This might be kind of a stupid and awkward question, but is there a way to save text on a histogram (eg a TPaveText object) without generating a TCanvas and a TFrame? I was wondering if there is something equivalent to the ListOfFunctions where one can embed a fit to a histogram object and later retrieve it with all its parameters.  
The most basic question is: If i want to put free floating text on my histogram and save the entire thing on my NTuple in a way that i can retrive the different objects later (not just a print) can this be done just using the TH1D class or I have to save the TCanvas?

My second question (since I started a topic here) is if FFTW is include in the standard LXPLUS root version. It seems not and again I am a bit confused since i though it became a standard part of root 6.

Thanks in advance for the help and sorry for my ordinance on this.

Cheers

Vagelis

_ROOT Version:_ 6.24.00 backwards compatible up to 5.34.36  
_Platform:_ Windows 10, but compatible with unix (using ifdefs)  
_Compiler:_ CINT and/or CLING  
Cross platform compatibility and backwards compatibility is an issue here…

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [June 21, 2021, 7:16am UTC](https://root-forum.cern.ch/t/saving-th1-histograms-in-root-file-with-embeded-texgt/45474/2 "2021-06-21T07:16:21Z")

</div>

Hi @luminociter ,  
I don’t _think_ there is a way, but let’s see if @couet has a suggestion.

Cheers,  
Enrico

---

<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 21, 2021, 7:51am UTC](https://root-forum.cern.ch/t/saving-th1-histograms-in-root-file-with-embeded-texgt/45474/3 "2021-06-21T07:51:11Z")

</div>

Yes the way to do it will be to use the list of functions.

```auto
root [0] auto h = new TH1F("h","h",10,0,1);
root [1] auto l = h->GetListOfFunctions()
(TList *) @0x7ffee638d840
root [2] l->ls()
OBJ: TList	TList	Doubly linked list : 0
root [3] auto T = new TText(.5,.5,"Some Text added on the histogram")
(TText *) @0x7ffee638d840
root [4] l->Add((TObject*)T);
root [5] l->ls()
OBJ: TList	TList	Doubly linked list : 0
 Text X=0.500000 Y=0.500000 Text=Some Text added on the histogram
root [6] h->Draw()

```

 ![Screenshot 2021-06-21 at 09.48.47](https://root-forum.cern.ch/uploads/default/original/3X/8/4/84fb72370f3d13862f0000847052a852cababdd9.jpeg)

Here I added a TText but you can any TObject (a TPaveText if you want). It will be part of the histogram and drawn when you draw the histogram.

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [June 21, 2021, 4:51pm UTC](https://root-forum.cern.ch/t/saving-th1-histograms-in-root-file-with-embeded-texgt/45474/4 "2021-06-21T16:51:42Z")

</div>

Thanks a lot, that works perfectly!
