# TMultiGraph Axis bins and Zoom

**URL:** <https://root-forum.cern.ch/t/tmultigraph-axis-bins-and-zoom/19149>\
**Category:** ROOT\
**Created:** [April 24, 2015, 3:03am UTC](https://root-forum.cern.ch/t/tmultigraph-axis-bins-and-zoom/19149 "2015-04-24T03:03:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 24, 2015, 7:04am UTC](https://root-forum.cern.ch/t/tmultigraph-axis-bins-and-zoom/19149/2 "2015-04-24T07:04:24Z")

</div>

I found the issue and I will fix it in root trunk.  
It is easy to bypass by adding a first graph. The problem shows up because you have only one graph.

```auto
{
   const UInt_t N=100000;
   Double_t x[N];
   Double_t y[N];
   for(int i=0;i<N;i++) {x[i]=i;y[i]=i+1;}
   TMultiGraph* mg = new TMultiGraph("mg","mg");
   TGraph* g1 = new TGraph(1); g1->SetPoint(0,0.,0.); mg->Add(g1);
   TGraph* gr = new TGraph(100000,x,y);
   mg->Add(gr);
   mg->Draw("a*");
   cout<<mg->GetXaxis()->GetNbins()<< " "<< gr->GetXaxis()->GetNbins() <<endl;
}
```

---

_[View the full topic](https://root-forum.cern.ch/t/tmultigraph-axis-bins-and-zoom/19149)._
