# Bug: Gl-in-pad axis binning are reversed

**URL:** <https://root-forum.cern.ch/t/bug-gl-in-pad-axis-binning-are-reversed/6666>\
**Category:** ROOT\
**Created:** [June 13, 2008, 10:23am UTC](https://root-forum.cern.ch/t/bug-gl-in-pad-axis-binning-are-reversed/6666 "2008-06-13T10:23:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthieuguillo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/c6cbf5/32.png) [@matthieuguillo](https://root-forum.cern.ch/u/matthieuguillo)\
**Post date:** [June 13, 2008, 10:23am UTC](https://root-forum.cern.ch/t/bug-gl-in-pad-axis-binning-are-reversed/6666/1 "2008-06-13T10:23:10Z")

</div>

Hello Rooters

I am using more and more gl-in-pad’s mode. When I draw a 2D histogram using regular mode, the x and y axis are corrrect, but when I display the same histogram in opengl, the bin numbering are reverted (and wrong).

Thanks

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [June 13, 2008, 11:23am UTC](https://root-forum.cern.ch/t/bug-gl-in-pad-axis-binning-are-reversed/6666/2 "2008-06-13T11:23:28Z")

</div>

Can you explain, please, what is wrong for you?

```auto
//2x2 2D hist, x range: -1..1, y range: -2..2.
gStyle->SetCanvasPreferGL(true);
TH2D * hist = new TH2D("lala", "lala", 2, -1., 1., 2, -2., 2.);
hist->SetBinContent(1, 1, 100);//do you understand, where is this bin?
hist->Draw("gllego");//

```

Look at bin\_1\_1.jpg, look at axes and status bar (it shows binx and biny number)  
After that, in ROOT console:

```auto
root [4] hist->SetBinContent(1, 2, 60);
```

See bin\_1\_2.jpg, axes and status bar.

```auto
root [4] hist->SetBinContent(2, 1, 30);
```

bin\_2\_1.jpg.

```auto
root [4] hist->SetBinContent(2, 2, 45);
```

So, what’s wrong?  
 ![](https://root-forum.cern.ch/uploads/default/original/2X/8/81c7b670cc80b5e911e29a2e4efb7b5891b3851c.jpg)  
  
 ![](https://root-forum.cern.ch/uploads/default/original/2X/3/33f5f3a70a918e0361c63aed9dbd024acc4e6ca7.jpg)  
  
 ![](https://root-forum.cern.ch/uploads/default/original/2X/b/bc753db49fab12582fd7845cf31344e7788f7f0d.jpg)  
  
 ![](https://root-forum.cern.ch/uploads/default/original/2X/6/65077f5400de9ca616e65b8b846c8559d4fbccd7.jpg)

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [June 13, 2008, 11:34am UTC](https://root-forum.cern.ch/t/bug-gl-in-pad-axis-binning-are-reversed/6666/3 "2008-06-13T11:34:26Z")

</div>

It’s not a bug. I draw lego hist from with viewer positioned in “positive quadrant”, that’s one of standard ways for mathematical pictures, look. for example, here:

[en.wikipedia.org/wiki/Image:Cart … h\_grid.svg](http://en.wikipedia.org/wiki/Image:Cartesian_with_grid.svg)

I have to draw axes on front edges of plot’s frame (I think it should be clear why). So, we have such picture.  
You can rotate non-gl plot and obtain the same results, look at my  
non-gl.jpg.  
 ![](https://root-forum.cern.ch/uploads/default/original/2X/c/c7aea3593915cd0bbaa4506599c473c42c966501.jpg)

---

<div class="post-metadata">

**Author:** ![matthieuguillo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/c6cbf5/32.png) [@matthieuguillo](https://root-forum.cern.ch/u/matthieuguillo)\
**Post date:** [June 13, 2008, 12:02pm UTC](https://root-forum.cern.ch/t/bug-gl-in-pad-axis-binning-are-reversed/6666/4 "2008-06-13T12:02:25Z")

</div>

Oups! I see my mistake now! Sorry for that.
