# Plot polar TH2

**URL:** <https://root-forum.cern.ch/t/plot-polar-th2/9476>\
**Category:** ROOT\
**Created:** [January 14, 2010, 11:10pm UTC](https://root-forum.cern.ch/t/plot-polar-th2/9476 "2010-01-14T23:10:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![zhiyiliu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/85e7bf/32.png) [@zhiyiliu](https://root-forum.cern.ch/u/zhiyiliu)\
**Post date:** [February 9, 2011, 10:26pm UTC](https://root-forum.cern.ch/t/plot-polar-th2/9476/6 "2011-02-09T22:26:41Z")

</div>

I do not know if it has been implemented yet. I worked out a solution for this long time ago and would post it here, may be helpful for other guys.

```auto
TCanvas * plot_histogram_in_polar(TH2D * h2d) {

  h2d->SetStats(false);
  TCanvas * can = new TCanvas("can", "", 600, 600);
  can->SetTheta(90);
  can->SetPhi(180);
  
  h2d->Draw("pollego2z");
  double ymax = h2d->GetYaxis()->GetXmax();
  double ymin = h2d->GetYaxis()->GetXmin();

  TGraphPolargram * gp = new TGraphPolargram("g",
                                             ymin, ymax,
                                             0, 2*TMath::Pi());
  gp->SetNdivRadial(4);
  gp->SetLineColor(17);
  gp->Draw();
  can->Update();
  
  TPaletteAxis *palette = (TPaletteAxis*)h2d->GetListOfFunctions()->FindObject("palette");
  palette->SetX1NDC(0.89);
  palette->SetX2NDC(0.92);
  palette->SetY1NDC(0.6);
  palette->SetY2NDC(0.97);
  palette->SetLabelSize(0.03);
  can->Modified();
  
  return can; 
}
```

> [@couet](#):
>
> Yes the angle is missing. That’s known . It has to be be implemented. I was just pointing out the fact that there is some axis.

---

_[View the full topic](https://root-forum.cern.ch/t/plot-polar-th2/9476)._
