# Getting the color axis of a colz histogram to a log scale

**URL:** <https://root-forum.cern.ch/t/getting-the-color-axis-of-a-colz-histogram-to-a-log-scale/50429>\
**Category:** Newbie\
**Created:** [June 15, 2022, 9:14pm UTC](https://root-forum.cern.ch/t/getting-the-color-axis-of-a-colz-histogram-to-a-log-scale/50429 "2022-06-15T21:14:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anelli](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f9ae1b/32.png) [@anelli](https://root-forum.cern.ch/u/anelli)\
**Post date:** [June 15, 2022, 9:14pm UTC](https://root-forum.cern.ch/t/getting-the-color-axis-of-a-colz-histogram-to-a-log-scale/50429/1 "2022-06-15T21:14:21Z")

</div>

I have a 2d histogram that I would like to draw as col or colz, but I want to have the color axis be in a log scale. I have tried basically every order and permutation of the following code (moving things around, commenting out and uncommenting), but none have worked.

```auto
//c1->SetLogz();
hist->Draw("colz");
//hist->Draw();
//hist->Draw("SPEC zs(1)");

```

If anyone knows how to get the color axis of a colz histogram to have a log scale, it would be very much appreciated.

I’m using root 6 on windows 11 if that matters.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [June 16, 2022, 4:43am UTC](https://root-forum.cern.ch/t/getting-the-color-axis-of-a-colz-histogram-to-a-log-scale/50429/2 "2022-06-16T04:43:38Z")

</div>

It’s probably something else in your code.  
This works for me:

```auto
{
   auto c1 = new TCanvas("c1","c1",600,400);
   auto harr = new TH2F("harr","COLZ example",20,-4,4,20,-20,20);
   harr->SetStats(0);
   float px, py;
   for (Int_t i = 0; i < 25000; i++) {
      gRandom->Rannor(px,py);
      harr->Fill(px,5*py);
      harr->Fill(3+0.5*px,2*py-10.,0.1);
   }
   c1->SetLogz();
   harr->Draw("COLZ");
}

```

Check if you get the same with this example. If not, it’s more helpful if you post the code you are using, or a minimal example code showing what you get.  
 ![c1](https://root-forum.cern.ch/uploads/default/original/3X/0/c/0c30b25fb7d3558dd41388097d2b9d8ff03e3108.png)
