as the title implies, I would like to know, how I can change the range of a log axis. The problem is this:
I have data ranging from 0 to approx. 100k and I need it on a log y-axis. To set the log axis I called c1->SetLogy() and later called t->Draw(“AL”), where t is of class TGraph. Unfortunately the Graph which is displayed only shows an y-axis ranging from 10^1 to 10^5. Thus everthing between 0-10 is not shown. I messed around wih several calls to the Tpad and the TAxis but none had the desired effect. I just now discovered in the example gerrors2 that it might be done defining a 2d histogramm, which sets the range but I wondered if there isn’t a more direct method to do this using TAxis or TPad.
Here is the short excerpt from my script. (c_)omega and (c_)count are arrays containing values from 0 to 100000.
Using Root Version 3.05/07, CINT 5.15.94 running under Linux/Debian 2.4.25-SMP (gcc 2.95.4)
[quote]
gROOT->Reset();
c1 = new TCanvas("c1", "Diffraktion", 0,0,500,500);
c1->SetGridx();
c1->SetGridy();
c1->SetLogy();
graph = new TGraph(n, omega, count);
calc = new TGraph(o, c_omega, c_count);
calc->Draw("AL");
graph->Draw("L");
c1->Update();
c1->Print();[/quote]
There at least two problems with your script
-you should never call gROOT->Reset() inside a named script. This resets all the previous variables definitions!
-you should replace
calc = new TGraph(o, c_omega, c_count);//Graph for cal
by
calc = new TGraph(f, c_omega, c_count);//Graph for cal
In your case o=122, but c_omega[121] is null, forcing an autorecomputaion of the Y scale in case of log y axis.
After these two corrections, you get the picture in attachement