How to change title/font size/etc. of graphs when using TTree::Draw()

Hi all,

I am using ROOT to present my data in graphs.
My idea is based on the tree1.C in tutorial files.
First, I will record everything in my file to a TTree.
After that, I will plot data in pads of canvas.
But when I tried to plot 20 pads in canvas, font size is really small. How can I change it?
One more thing, how can I change my y axis range? I always have to do it manually one by one. I prefer some command lines.
With x axis, I can do it very easily.

Here is a part of code. Say, “rx_time” and “rx_speed” is data on y axis and “i” is x-axis.

[code]void tree1r(Long64_t nentries, Long64_t start_entry, int option)
{
TFile *f = new TFile(“tree1.root”); //I stored data in tree1.root; I open it to plot graphs & histograms
TTree t1 = (TTree)f->Get(“t1”);

TCanvas* c1 = new TCanvas(“c1”);

c1->Divide(4,5);

c1->cd(1);
t1->Draw("rx_speed:i"  ,"","L",nentries,start_entry);
 
c1->cd(2);
t1->Draw("rx_time:i"   ,"","L",nentries,start_entry);

c1->Update();
c1->Modified();
} [/code]

I appreciate for all of comments and suggestions.
Regards,

Look at: Retrieving the result of Draw
in root.cern.ch/doc/master/classTTree.html

Dear couet,
Thank you so much.
My software now successfully works.
Here is part of my code (in case someone else needs):

void tree1r(Int_t nentries, Int_t start_entry, Int_t option)
{
   //modified from $ROOTSYS/tutorials/tree/tree1.C (Rene Brun)
       
   TFile *f = new TFile("tree1.root");
   TTree *t1 = (TTree*)f->Get("t1");
   TCanvas* c1 = new TCanvas("c1","",1240,800);

   c1->Divide(3,3);
   
   /* draw graph of 2 elements of TTree*/
   c1->cd(1);
   pad = c1->cd(1);
   pad->SetLogy(0);
   t1->Draw("rx_speed:i","","AL",nentries,start_entry);
   TGraph *gr = (TGraph*)gPad->GetPrimitive("Graph");
   gr->SetTitle("rx_speed/transaction");
   //gr->CenterTitle();
   gr->GetYaxis()->SetTitle("(MB/sec)");
   gr->GetYaxis()->CenterTitle();
   gr->GetXaxis()->SetTitle("#transaction");
   gr->GetXaxis()->CenterTitle();

   /* draw histogram of an element of TTree */
   c1->cd(3);
   pad = c1->cd(3);
   pad->SetLogy(0);
   t1->Draw("rx_speed","","L",nentries,start_entry);
   TH1F *hist = (TH1F*)gPad->GetPrimitive("htemp");
   hist->SetTitle("rx_speed histogram");
   hist->GetXaxis()->SetTitle("rx_speed (MB/sec)");
   hist->GetXaxis()->CenterTitle();
   hist->GetYaxis()->SetTitle("counts");
   hist->GetYaxis()->CenterTitle();

   c1->Update();
   c1->Modified();
}   
1 Like