Re: log scale

Rene Brun (Rene.Brun@cern.ch)
Wed, 14 May 1997 09:04:35 +0200


Wolfgang Korsch wrote:
>
> Hi,
>
> I have data which span a range from 1e-6 to 1e-1 (in x) and
> I would like to display them on a log scale (in x).
> The command "ntuple->SetLogx(1);" does only display from 1e-5 to
> 1e-2, also filling a (2d) hist doesn't seem to help.
> How can I set my x-axis from 1e-6 to 1e-1 ?

SetLogx is not a member function of TTree but TPad.
Example:

Root > c1 = new TCanvas("c1")
Root > c1->SetLogx();
Root > TH2F h2("h2","example",2,1.e-6,1.e-1,2,0,100)
Root > h2.Draw()
Root > // assume you have somewhere two arrays on n points x and y
Root > gr = new TGraph(n,x,y)
Root > gr->Draw("L")

Rene Brun