# Removing time stamp on root plots

**URL:** <https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588>\
**Category:** Newbie\
**Created:** [November 8, 2021, 5:03pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588 "2021-11-08T17:03:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 5:03pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/1 "2021-11-08T17:03:27Z")

</div>

Hello experts,

I was wondering if there is a way to get rid of the time stamp that shows up by default when generating a root plot? Please, see the attached example plot below. I am referring to the “Mon Nov 8 11:54:25 2021” portion of the plot, and if there is a command I can include in my plotting macro that will turn off the feature of showing a time stamp. Thank you very much!

 ![Screen Shot 2021-11-08 at 10.56.45 AM](https://root-forum.cern.ch/uploads/default/original/3X/c/2/c28e753b0817f4f1e8b2265e8595600d0596be70.png)

---

<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:** [November 8, 2021, 5:15pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/2 "2021-11-08T17:15:05Z")

</div>

If you want to remove the “time stamp”, you need to **exclude** the commands that draw it from your plotting macro.

---

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 5:21pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/3 "2021-11-08T17:21:13Z")

</div>

Hello @Wile_E_Coyote,

Thank you very much for the quick reply!

When I look at my plotting macro, which is a modified version of a template I found online, I do not see an explicit place where the plotting macro executes a command to show the timestamp. Any thoughts on this? Please, see my attached plotting macro below.

```auto
void scatterPlots_tofQA()
{
        TString inputFileName = TString("./test_TofQAOutFile_16127006.root");
        TFile* inputFile = new TFile(inputFileName.Data());

        TIter keyList(inputFile->GetListOfKeys());
        TKey *key;
        TCanvas c1;
        c1.Print("scatterPlots_tofQA.pdf[");
        while ((key = (TKey*)keyList())) {
                TClass *cl = gROOT->GetClass(key->GetClassName());
                if (!cl->InheritsFrom("TH2")) continue;
                TH2 *h = (TH2*)key->ReadObj();
                string histoName = h->GetName();
                cout << h->GetName() << endl;
                gStyle->SetOptStat(111111);
                gStyle->SetStatY(0.99);
                gStyle->SetStatX(0.9);
                gStyle->SetStatW(0.2);
                gStyle->SetStatH(0.12);
                h->Draw("colz");
                c1.Print("scatterPlots_tofQA.pdf");
        }
        c1.Print("scatterPlots_tofQA.pdf]");
}

```

---

<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:** [November 8, 2021, 5:27pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/4 "2021-11-08T17:27:16Z")

</div>

For test purposes, add there (maybe that’s where the “time stamp” is hiding):

```cpp
std::cout << h->GetXaxis()->GetTitle() << std::endl;
std::cout << h->GetYaxis()->GetTitle() << std::endl;

```

---

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 5:31pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/5 "2021-11-08T17:31:26Z")

</div>

I added those test statements and here is the output. It doesn’t seem like anything is stored in the axis titles.

```auto
root4star -l -b -q scatterPlots_tofQA.C
root4star [0] 
Processing scatterPlots_tofQA.C...
Info in <TCanvas::Print>: pdf file scatterPlots_tofQA.pdf has been created
h2_JP2_numGTrkBTofHitsVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_numGTrkBTofHitsVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_numPTrkBTofHitsVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_numPTrkBTofHitsVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_jetPtVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_jetPtVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_jetEtaVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_jetEtaVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_jetPhiVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_jetPhiVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_jetRtVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_jetRtVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_jetTrackMultVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_jetTrackMultVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_JP2_jetTowerMultVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
h2_BBCMB_jetTowerMultVsNumBTofHits

Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf
Info in <TCanvas::Print>: Current canvas added to pdf file scatterPlots_tofQA.pdf

This is the end of ROOT -- Goodbye

```

---

<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:** [November 8, 2021, 5:36pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/6 "2021-11-08T17:36:43Z")

</div>

Try the standard “`root -n`” instead of “`root4star`”.  
Try also “`root4star -n ...`”.

---

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 5:45pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/7 "2021-11-08T17:45:20Z")

</div>

I tried both `root -n ` and `root4star -n` and they both lead to the same output attached below. However, now the histogram title is a off and I also lost the grid. But, the time stamp did go away.

 ![Screen Shot 2021-11-08 at 11.43.48 AM](https://root-forum.cern.ch/uploads/default/original/3X/4/a/4a5918bcc29accf1dd92228181921a9ed08213c8.png)

---

<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:** [November 8, 2021, 5:49pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/8 "2021-11-08T17:49:48Z")

</div>

Search for “`rootlogon.C`” and “`.rootrc`” files (in your “`${HOME}`” and the current working directory).

---

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 5:54pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/9 "2021-11-08T17:54:05Z")

</div>

Thank you very much! I will give those a shot and see how it goes!

---

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 6:03pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/10 "2021-11-08T18:03:26Z")

</div>

The solution ended up being that I added `gStyle->SetOptDate(0)` right before `gStyle->SetOptStat(111111)` in my plotting macro, and the timestamp went away. 🙂 Below is the output.

 ![Screen Shot 2021-11-08 at 12.01.17 PM](https://root-forum.cern.ch/uploads/default/original/3X/a/3/a3bad967829d4dde99b5057065e71bb09503ac66.png)

---

<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:** [November 8, 2021, 6:35pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/11 "2021-11-08T18:35:25Z")

</div>

Just for future reference … where was this “`gStyle->SetOptDate(some_non_zero_value)`” coming from?

---

<div class="post-metadata">

**Author:** ![Bassam](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@Bassam](https://root-forum.cern.ch/u/Bassam)\
**Post date:** [November 8, 2021, 7:28pm UTC](https://root-forum.cern.ch/t/removing-time-stamp-on-root-plots/47588/12 "2021-11-08T19:28:11Z")

</div>

I am honestly not sure where it is coming from. I am also not really sure where to look besides my macro.
