# Same color palette range for several TH3 drawn with glcolz

**URL:** <https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625>\
**Category:** ROOT\
**Created:** [December 18, 2014, 3:11pm UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625 "2014-12-18T15:11:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbungau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@cbungau](https://root-forum.cern.ch/u/cbungau)\
**Post date:** [December 18, 2014, 3:11pm UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/1 "2014-12-18T15:11:12Z")

</div>

Hi

I have several TH3F histograms which I am drawing with “glcolz”. I was wondering if it is possible to use the same colors for all of them, so all to be drawn showing the same (0 - 30) rang on the color palette, even if the actual maximum bin content is below 30 for most of them. I have attached a figure to illustrate what I have at the moment.

Thank you,

Cristian

 ![](https://root-forum.cern.ch/uploads/default/original/2X/c/c042feeef215eac3e1d833278e10efdc4792482f.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:** [December 18, 2014, 4:11pm UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/2 "2014-12-18T16:11:24Z")

</div>

I think you should specify the same maximum and minimum for all the histograms.

---

<div class="post-metadata">

**Author:** ![cbungau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@cbungau](https://root-forum.cern.ch/u/cbungau)\
**Post date:** [December 18, 2014, 7:31pm UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/3 "2014-12-18T19:31:24Z")

</div>

Hello,

Thank you for your reply.

Specifying

hist\_power\_1-\>SetMinimum(0.);  
hist\_power\_1-\>SetMaximum(30.);  
hist\_power\_2-\>SetMinimum(0.);  
hist\_power\_2-\>SetMaximum(30.);  
etc

before drawing, for all histograms, does not change the results. It is not that I want the color palette to not exceed a certain maximum, I actually want the color palette to go above the maximum bin content, and this way have the same color palette for all histograms for a direct comparisson.

Best regards,

Cristian

---

<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:** [December 19, 2014, 9:24am UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/4 "2014-12-19T09:24:22Z")

</div>

Indeed, the maximum on a histogram is not used

---

<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:** [December 19, 2014, 9:38am UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/5 "2014-12-19T09:38:54Z")

</div>

I once applied a “brutal fix” to such a problem.  
I modified all relevant histograms destroying two bins:  
MyHisto-\>SetBinContent(1, 1, MyMinimum);  
MyHisto-\>SetBinContent(MyHisto-\>GetNbinsX(), MyHisto-\>GetNbinsY(), MyMaximum);

---

<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:** [December 19, 2014, 9:50am UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/6 "2014-12-19T09:50:19Z")

</div>

I think we will have to modify the code to take care of the minimum and maximum like for TH2

---

<div class="post-metadata">

**Author:** ![AnneS](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@AnneS](https://root-forum.cern.ch/u/AnneS)\
**Post date:** [October 16, 2015, 11:52am UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/7 "2015-10-16T11:52:08Z")

</div>

I have exactly the same problem.  
Is this actually solved by now? So, can you access the color axis and set its range in TH3 histograms?

Thanks a lot in advance!  
🙂

---

<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 19, 2015, 11:12am UTC](https://root-forum.cern.ch/t/same-color-palette-range-for-several-th3-drawn-with-glcolz/18625/8 "2015-10-19T11:12:05Z")

</div>

Nothing has change here. May be post a Jira ticket.
