Hi, I have a TMultigraph which contains a single TGraph that consists of approximately 100,000 points. I am attempting to zoom in the Xaxis to a specific region (using SetRange, not SetLimits, as the latter seems to break unzoom), but I am finding that the underlying histogram for the TMultigraph only contains 100 bins! Needless to say this is not enough to get a close view of a small subset of 100,000 points.
Here is an example:
{
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* gr = new TGraph(100000,x,y);
mg->Add(gr);
mg->Draw("al");
cout<<mg->GetXaxis()->GetNbins()<<endl;
}
Output: 100
Interestingly if I do gr->Draw(“al”) then gr->GetXaxis()->GetNbins(), I get 100000 as expected. However, I wish to have this graph contained in a TMultiGraph in case I want to add more graphs in the future.
How can I force TMultiGraph to use more bins?
Chris