# TGraph2D: logarithmic z-axis

**URL:** <https://root-forum.cern.ch/t/tgraph2d-logarithmic-z-axis/16525>\
**Category:** ROOT\
**Created:** [August 14, 2013, 3:44pm UTC](https://root-forum.cern.ch/t/tgraph2d-logarithmic-z-axis/16525 "2013-08-14T15:44:23Z")\
**Posts on this page:** 1\
**Showing post:** 19

<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 6, 2017, 1:05pm UTC](https://root-forum.cern.ch/t/tgraph2d-logarithmic-z-axis/16525/19 "2017-07-06T13:05:35Z")

</div>

Now fixed in master:

```auto
{
   TCanvas *c = new TCanvas("c","Graph2D example",0,0,600,400);
   Double_t x, y, z, P = 6.;
   Int_t np = 200;
   TGraph2D *dt = new TGraph2D();
   TRandom *r = new TRandom();
   for (Int_t N=0; N<np; N++) {
      x = 2*P*(r->Rndm(N))-P;
      y = 2*P*(r->Rndm(N))-P;
      z = (sin(x)/x)*(sin(y)/y)+0.2;
      dt->SetPoint(N,x,y,z);
   }
   gStyle->SetPalette(1);
   gPad->SetLogz();
   dt->SetMarkerStyle(20);
   dt->Draw("pcolz");
   c->SetPhi(0.00001);
   c->SetTheta(0.00001);
}

```

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

---

_[View the full topic](https://root-forum.cern.ch/t/tgraph2d-logarithmic-z-axis/16525)._
