# COLZ is not showing the axis numbers fully

**URL:** <https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154>\
**Category:** Newbie\
**Tags:** graphics, hist, root\
**Created:** [December 22, 2021, 6:47pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154 "2021-12-22T18:47:32Z")\
**Posts on this page:** 5\
**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:** [December 22, 2021, 6:47pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154/1 "2021-12-22T18:47:32Z")

</div>

Hello experts,

I am having an issue when plotting a 2D histogram with the “colz” option. When I look at the z-axis, the numbers on the ticks are not fully displayed. It is as if the numbers go beyond what the canvas can show. Notice how the 10^-1 is chopped off on the z-axis. I checked other topics on this forum, but non of them addressed my issue. Can you please help me with this? Thank you very much in advance!

Here is the relevant code:

```auto
        TString inputFileName = TString("./qaTest_2022pp500_22351049.hist.root");
        TFile* inputFile = new TFile(inputFileName.Data());
        TCanvas *c1 = new TCanvas("c1");
        gStyle->SetOptDate(0);
        gStyle->SetOptStat(111111);
        gStyle->SetStatY(0.99);
        gStyle->SetStatX(0.9);
        gStyle->SetStatW(0.2);
        gStyle->SetStatH(0.12);
        TH2D* Th2Hist_1 = (TH2D*)inputFile->Get("AllTriggers_h2_eventBx7VsBx48");
        c1->SetLogz();
        Th2Hist_1->Draw("colz");

```

The output is:

 ![example2D](https://root-forum.cern.ch/uploads/default/original/3X/c/4/c49eac82ca619cae4d60cae6b1a614d3475021b0.png)

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [December 22, 2021, 7:48pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154/2 "2021-12-22T19:48:57Z")

</div>

Hi,

right after

> [@Bassam](#):
>
> `TCanvas *c1 = new TCanvas("c1");`

, add

```c++
c1->SetRightMargin(0.18);

```

(you may need to tweak the 0.18 value a bit to suit your needs).

---

<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:** [December 22, 2021, 8:42pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154/3 "2021-12-22T20:42:53Z")

</div>

> [@yus](#):
>
> `c1->SetRightMargin(0.18);`

Thank you very much, @yus! This solves my issue!

---

<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 23, 2021, 6:34pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154/4 "2021-12-23T18:34:03Z")

</div>

Also note: [The Rainbow Color Map - ROOT](https://root.cern/blog/rainbow-color-map/)

---

<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:** [December 23, 2021, 8:56pm UTC](https://root-forum.cern.ch/t/colz-is-not-showing-the-axis-numbers-fully/48154/5 "2021-12-23T20:56:38Z")

</div>

Thank you very much @couet! I will take a look at it! 🙂
