Simple question about plotting/plotting documentation

Hi ROOTers,

I’m afraid I’m still quite a ROOT beginner. My question is:

  1. How can you force the xrange to run from 0->X and how can you make the yrange logarithmic…

  2. *BUT more importantly my question is: Could anyone teach me how to use the ROOT documentation so that I could answer these questions myself. Keep in mind I’m a ROOT beginner.

Many Thanks,
Will

In ROOT in general the canvas/pad scale is automatically computed from the
object itself: graph, histogram, function.
For example

TH1F *h1 = new TH1F("h1","test",100,-3,3); h1->FillRandom("gaus",5000); h1->Draw();
If you want to do something special with the pad (log x,y scale, etc),
you can do something like

TCanvas *c1 = new TCanvas; c1->SetLogy(); TH1F *h1 = new TH1F("h1","test",100,-3,3); h1->FillRandom("gaus",5000); h1->SetMinimum(1); h1->Draw();

[quote]2. *BUT more importantly my question is: Could anyone teach me how to use the ROOT documentation so that I could answer these questions myself. Keep in mind I’m a ROOT beginner.
[/quote]

I strongly suggest to read the first 2 or 3 chapters of the Users Guide
and get some experince by running the tutorials, eg
$ROOTSYs/tutorials/hist, graphs, graphics

 Rene

Thanks Rene,

  1. What if the histogram came from a .root file, ie:

TFile *f = new TFile(“something.root”);

and this something.root has a TH1D object inside called “A”

how do I make sure that A’s xrange runs from 0->X when I do a A->Draw()?

  1. Will do. Thanks for the suggestion.

Thanks,
Will

[quote]1. What if the histogram came from a .root file, ie:

TFile *f = new TFile(“something.root”);

and this something.root has a TH1D object inside called “A”

how do I make sure that A’s xrange runs from 0->X when I do a A->Draw()? [/quote]
Do, eg

TFile *f = new TFile("something.root"); TH1D *hA; f->GetObject("A",hA); TCanvas *c1 = new TCanvas; c1->SetLogy(); c1->DrawFrame(0,1,X,1.1*hA->GetMaximum()); hA->Draw("same");
Rene