# TH2 polar plot problem

**URL:** <https://root-forum.cern.ch/t/th2-polar-plot-problem/45754>\
**Category:** Newbie\
**Created:** [July 8, 2021, 12:21pm UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754 "2021-07-08T12:21:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [July 8, 2021, 12:21pm UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/1 "2021-07-08T12:21:39Z")

</div>

hi dear expert,  
I have a problem with TH2 for polar drawing.  
I draw TH2D with `pol surf2 C` options and got this :

 ![unnamed](https://root-forum.cern.ch/uploads/default/original/3X/f/2/f2ccab1a3041df1f3ae16b58d3ebb9c8a7d35388.png)

I don’t know why there is a white circle at the center.  
if it is drawn with `pol lego2 C` options there will not be a white circle at the center.  
histogram was defined as:

> new TH2D(“2d\_PrimaryedepKernels”, “2d\_PrimaryedepKernels”, 96, 0, 96, 24, 0, 24)

and filled by Monte Carlo simulation.  
how can fix it?  
I attached .root and plot.c file.

[result.root](https://root-forum.cern.ch/uploads/short-url/jJHOBUj4Fj1diatqKY9J9QHdoM9.root) (109.3 KB)  
[plot.c](https://root-forum.cern.ch/uploads/short-url/aQsFxSGhpG9Wy1eUENazHLqWjfF.c) (30.9 KB)

many thanks,

---

<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:** [July 8, 2021, 12:45pm UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/2 "2021-07-08T12:45:09Z")

</div>

> [@Keyvan\_Tabaei](#):
>
> I don’t know why there is a white circle at the center.

Because the SURF options work with the bin centers. You see the same “margin” without option POL on all the SURF plots.

---

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [July 8, 2021, 3:00pm UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/3 "2021-07-08T15:00:56Z")

</div>

hi couet,  
thank you for your reply,

so how can i plot it without losing data around the center?  
i want to see those countors like the above picture, using lego option is not what i want

many thanks

---

<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:** [July 8, 2021, 3:14pm UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/4 "2021-07-08T15:14:20Z")

</div>

The data are not lost. They surface goes trough the bin center. So you get this margin autos in cartesian (that’s not a margin)

 ![Screenshot 2021-07-08 at 17.13.05](https://root-forum.cern.ch/uploads/default/original/3X/a/2/a20c69e13ffc6b907aa437a0c8fdfd5504d68fe9.jpeg)

---

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [July 8, 2021, 4:37pm UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/5 "2021-07-08T16:37:35Z")

</div>

thank you,  
data are not lost, I was wrong.  
TH2’s x bins represent cone angles, from 0 to 48 (0 to 180 degrees) these make a sphere, and y bins represent radius, these bins contain values I want to draw these values as contour(isolines).

the first picture that i sent show isoline very well but there is a white circle,

is there any method to draw isoline (contour) by using these data?

---

<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:** [July 9, 2021, 5:39am UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/6 "2021-07-09T05:39:37Z")

</div>

> [@Keyvan\_Tabaei](#):
>
> is there any method to draw isoline (contour) by using these data?

Have look at the [CONT options](https://root.cern/doc/master/classTHistPainter.html#HP16).

---

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [July 9, 2021, 8:24am UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/7 "2021-07-09T08:24:08Z")

</div>

thank you couet,  
i found that my data needs a logarithm scale when reading your article here [The Rainbow Color Map - ROOT](https://root.cern/blog/rainbow-color-map/)

so i got this

 ![unna](https://root-forum.cern.ch/uploads/default/original/3X/3/2/3275c792e2bf8efc1ff89b73ce731a3cc6a794c7.png)  
there are many differences between two pictures from the same data, in my case logarithm scale is better because there are a wide range of values.

is there a way to remove the grid that appears with the `lego` option?  
is it possible to plot it with contour lines?

---

<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:** [July 9, 2021, 8:49am UTC](https://root-forum.cern.ch/t/th2-polar-plot-problem/45754/8 "2021-07-09T08:49:36Z")

</div>

> [@Keyvan\_Tabaei](#):
>
> is there a way to remove the grid that appears with the `lego` option?

[Here](https://root.cern/doc/master/classTHistPainter.html#HP17) you can read:

“LEGO3” Draw a lego plot with hidden surface removal, like LEGO1 but the border lines of each lego-bar are not drawn.

> [@Keyvan\_Tabaei](#):
>
> is it possible to plot it with contour lines?

No, LEGO plots are not contour plots.
