# Variable histogram title

**URL:** <https://root-forum.cern.ch/t/variable-histogram-title/36672>\
**Category:** Newbie\
**Created:** [November 4, 2019, 11:37pm UTC](https://root-forum.cern.ch/t/variable-histogram-title/36672 "2019-11-04T23:37:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schniefen](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/74df32/32.png) [@schniefen](https://root-forum.cern.ch/u/schniefen)\
**Post date:** [November 4, 2019, 11:37pm UTC](https://root-forum.cern.ch/t/variable-histogram-title/36672/1 "2019-11-04T23:37:36Z")

</div>

Consider declaring a 1D histogram like

```auto
TH1D* hist = new TH1D("Stats", "Temp. per day at 12 in 1988; Day; Temperature [#circC]", 
			366, 0, 366);

```

Is it possible to include parameters in the title setting part? This is part of a function that takes an hour (12 in this case) and a year (1988) and draws a histogram.

---

<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:** [November 5, 2019, 8:08am UTC](https://root-forum.cern.ch/t/variable-histogram-title/36672/2 "2019-11-05T08:08:28Z")

</div>

Yes, use Form:

```auto
TH1D* hist = new TH1D("Stats", Form("Temp. per day at %d in %d; Day; Temperature [#circC]", h,y), 
			366, 0, 366);

```

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 19, 2019, 8:08am UTC](https://root-forum.cern.ch/t/variable-histogram-title/36672/3 "2019-11-19T08:08:39Z")

</div>

Closed on November 19, 2019, 8:08am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
