Hi,
I was playing around with roofit tutorial 108 and added at the bottom these lines:
// Draw plots on canvas
TCanvas* c = new TCanvas("rf108_plotbinning","rf108_plotbinning",800,400) ;
c->Divide(2) ;
c->cd(1) ; gPad->SetLeftMargin(0.15) ; dtframe->GetYaxis()->SetTitleOffset(1.6) ; dtframe->Draw() ;
c->cd(2) ; gPad->SetLeftMargin(0.15) ; aframe->GetYaxis()->SetTitleOffset(1.6) ; aframe->Draw() ;
c->SaveAs("blub.C");
c->SaveAs("blub2.C");
c->SaveAs("blub2.pdf");
c->SaveAs("blub3.C");
(using root 6.07/04, self built from git)
And compared the macros.
Observations:
[ul][li]when just calling the macros the first canvas is larger than the others[/li]
[li]the title font looks larger in the third[/li][/ul]
variable names aside, the actual macros differ in the following places. blub.C and blub2.C
- TCanvas *rf108_plotbinning = new TCanvas("rf108_plotbinning", "rf108_plotbinning",0,0,800,400);
+ TCanvas *rf108_plotbinning = new TCanvas("rf108_plotbinning", "rf108_plotbinning",1,1,800,376);
(afterwards, blub2.C and blub3.C have the same TCanvas constructor)
comparing blub2.C to blub3.C, blub3.C has a lot more code
rf108_plotbinning_1->SetFrameBorderMode(0);
gets called twice in blub3.C
TH1F *Graph_bmix_AsymoBmixStatecB6 = new TH1F("Graph_bmix_AsymoBmixStatecB6","mixState Asymmetry of dec
Graph_bmix_AsymoBmixStatecB6->SetMinimum(-0.9585547);
Graph_bmix_AsymoBmixStatecB6->SetMaximum(0.9589456);
Graph_bmix_AsymoBmixStatecB6->SetDirectory(0);
Graph_bmix_AsymoBmixStatecB6->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_bmix_AsymoBmixStatecB6->SetLineColor(ci);
Graph_bmix_AsymoBmixStatecB6->GetXaxis()->SetLabelFont(42);
Graph_bmix_AsymoBmixStatecB6->GetXaxis()->SetLabelSize(0.035);
Graph_bmix_AsymoBmixStatecB6->GetXaxis()->SetTitleSize(0.035);
Graph_bmix_AsymoBmixStatecB6->GetXaxis()->SetTitleFont(42);
Graph_bmix_AsymoBmixStatecB6->GetYaxis()->SetLabelFont(42);
Graph_bmix_AsymoBmixStatecB6->GetYaxis()->SetLabelSize(0.035);
Graph_bmix_AsymoBmixStatecB6->GetYaxis()->SetTitleSize(0.035);
Graph_bmix_AsymoBmixStatecB6->GetYaxis()->SetTitleFont(42);
Graph_bmix_AsymoBmixStatecB6->GetZaxis()->SetLabelFont(42);
Graph_bmix_AsymoBmixStatecB6->GetZaxis()->SetLabelSize(0.035);
Graph_bmix_AsymoBmixStatecB6->GetZaxis()->SetTitleSize(0.035);
Graph_bmix_AsymoBmixStatecB6->GetZaxis()->SetTitleFont(42);
graph->SetHistogram(Graph_bmix_AsymoBmixStatecB6);
blub.C and blub2.C don’t have any TH1 at all.
pt = new TPaveText(0.15,0.9291672,0.85,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
AText = pt->AddText("mixState asymmetry distribution with custom binning");
pt->Draw();
again, blub.C and blub2.C don’t create any TText or TPaveText at all.
Is it expected that the output of TCanvas::SaveAs(“foobar.C”) depends on previous SaveAs calls?
rf108_plotbinning.C (4.13 KB)
blub3.C (25.6 KB)
blub2.C (19.2 KB)
blub.C (19.2 KB)