# Palette on a TProfile2d

**URL:** <https://root-forum.cern.ch/t/palette-on-a-tprofile2d/14704>\
**Category:** ROOT\
**Created:** [August 3, 2012, 9:57pm UTC](https://root-forum.cern.ch/t/palette-on-a-tprofile2d/14704 "2012-08-03T21:57:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![McCuack](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@McCuack](https://root-forum.cern.ch/u/McCuack)\
**Post date:** [August 3, 2012, 9:57pm UTC](https://root-forum.cern.ch/t/palette-on-a-tprofile2d/14704/1 "2012-08-03T21:57:20Z")

</div>

Dear rooters

before I had posted this, I expend a lot of time on the web and forums an practically nothing (perhaps not correct words, but I tried hard). Here is my question…

I have a set of variables (xbc,ybc,q2) read them from a root file without any problem. I produce a TProfile2D as

```auto

```

as you can see, the range of my Z axis (q2 as variable) is between 8 and 20 since the data from q2 do not go out of this range, in fact could a smaller range but it is just a temptative to start. I fill the TProfile2D (of course in the appropiate for loop reading the events of the root file)

```auto

```

and draw as normal

```auto

```

Now, the color palette marks the range from 0 to 14. Upper limit is ok for me, but lower limit is too low, and restricts my plot to very small gradient around one color. I understand that it is because the palette takes the empty bins as 0 and it marks the lower limit.

I would like to know if it is possible to change the range of the palette to a scale more adjusted to my data. Somewhere I read, the idea is with TH2D::SetMinimum( ) ; so I tried but doesn’t work:

`
h4bprof->SetMinimum(6);`

(console output)

* * *

Error: Can’t call TProfile2D::SetMinimun(6) in current scope tree.c:356:  
Possible candidates are…  
(in TProfile2D)  
(in TH2D)  
(in TH2)  
(in TH1)  
\*\*\* Interpreter error recovered \*\*\*

Can I get some hint from experts? Thank you

---

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [August 3, 2012, 10:12pm UTC](https://root-forum.cern.ch/t/palette-on-a-tprofile2d/14704/2 "2012-08-03T22:12:04Z")

</div>

Try:  
h4bprof-\>SetAxisRange(8, 20, “Z”);  
and/or:  
h4bprof-\>GetZaxis()-\>SetRangeUser(8, 20);  
Actually, I believe this should work as well:  
h4bprof-\>SetMinimum(8);  
h4bprof-\>SetMaximum(20);  
See also:  
[url][SetAxisRange(0.0,1.0,“Y”); is ineffective](https://root-forum.cern.ch/t/setaxisrange-0-0-1-0-y-is-ineffective/14040/1)  
[url][Drawing a TGraphAsymmErrors](https://root-forum.cern.ch/t/drawing-a-tgraphasymmerrors/14205/1)

BTW. You have a typo in your “tree.c” file in line 356 … “SetMinimun” does NOT exist at all (note that the last character in this name is a “n” instead of a “m”) … I think that’s where your problem originates …

---

<div class="post-metadata">

**Author:** ![McCuack](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@McCuack](https://root-forum.cern.ch/u/McCuack)\
**Post date:** [August 6, 2012, 4:54pm UTC](https://root-forum.cern.ch/t/palette-on-a-tprofile2d/14704/3 "2012-08-06T16:54:16Z")

</div>

thank you very much.

Even the typo (what solves the problem as you suggested), is interesting the other code.

Thank you again.
