Font sizes in subpads

Hello everybody,

I try to plot several drawings in one canvas (see example below). Therefore I divide the canvas into sub pads of different sizes. When I draw the graphs into the sub pads the (absolute) font size of each graph is different.
Is there a way to tell ROOT to use the same (absolute) font sizes in all sub pads?

Thanks for your help,
Florian

{
double x[]={1,2,3,4,5};

double y1[]={1,30,2,4000,100};
TGraph *gr1 = new TGraph(5,x,y1);
gr1->SetMarkerStyle(27);
gr1->GetXaxis()->SetTitle(“myytitle”);
gr1->GetYaxis()->SetTitle(“myxtitle”);

double y2[]={1,1.1,0.9,0.8,0.7};
TGraph *gr2 = new TGraph(5,x,y2);
gr2->SetMarkerStyle(27);
gr2->GetXaxis()->SetTitle(“myytitle”);
gr2->GetYaxis()->SetTitle(“myxtitle”);

TCanvas *c2 = new TCanvas(“c2”,“c2”,0,0,1200,800);
c2->Divide(1,2);
c2_1->SetPad(.005,.305,.995,.995);
c2_1->SetLogy();
c2_2->SetPad(.005,.005,.995,.295);

c2_1->cd();
gr1->Draw(“alp”);
c2_2->cd();
gr2->Draw(“alp”);
}

Hi Florian,

Use fonts precision 3
See: http://root.cern.ch/root/htmldoc//TAttText.html

I have modified your example. See below

[code]{
double x[]={1,2,3,4,5};

double y1[]={1,30,2,4000,100};
TGraph *gr1 = new TGraph(5,x,y1);
gr1->SetMarkerStyle(27);
gr1->GetXaxis()->SetTitle(“myytitle”);
gr1->GetYaxis()->SetTitle(“myxtitle”);
gr1->GetYaxis()->SetLabelFont(63);
gr1->GetYaxis()->SetLabelSize(16); //in pixels
gr1->GetXaxis()->SetLabelFont(63);
gr1->GetXaxis()->SetLabelSize(18); //in pixels

double y2[]={1,1.1,0.9,0.8,0.7};
TGraph *gr2 = new TGraph(5,x,y2);
gr2->SetMarkerStyle(27);
gr2->GetXaxis()->SetTitle(“myytitle”);
gr2->GetYaxis()->SetTitle(“myxtitle”);
gr2->GetYaxis()->SetTitleFont(63);
gr2->GetYaxis()->SetTitleSize(16); //in pixels
gr2->GetXaxis()->SetTitleFont(63);
gr2->GetXaxis()->SetTitleSize(16); //in pixels
gr2->GetYaxis()->SetLabelFont(63);
gr2->GetYaxis()->SetLabelSize(16); //in pixels
gr2->GetXaxis()->SetLabelFont(63);
gr2->GetXaxis()->SetLabelSize(18); //in pixels

TCanvas *c2 = new TCanvas(“c2”,“c2”,0,0,1200,800);
c2->Divide(1,2);
c2_1->SetPad(.005,.305,.995,.995);
c2_1->SetLogy();
c2_2->SetPad(.005,.005,.995,.295);

c2_1->cd();
gr1->Draw(“alp”);
c2_2->cd();
gr2->Draw(“alp”);
}
[/code]

Rene