I’m having trouble understanding the output of the default and lego draw option. They seem to ignore the setlogy option, the scale on the y-axis is definitely log scale but the plots have the shape as if they were on a normal axis scale. I have these plots with four of the THStack options: StackPt.pdf (33.6 KB)
The code is as follows:
TH1F *highWeightPt = nullptr;
TH1F *withoutHighWeightPt=nullptr;
highWeightPt=(TH1F*)f2->Get("h");
highWeightPt->SetFillColor(kRed);
highWeightPt->SetMarkerStyle(21);
highWeightPt->SetMarkerColor(kRed);
withoutHighWeightPt = (TH1F*)_file0->Get("h");
withoutHighWeightPt->SetFillColor(kBlue);
withoutHighWeightPt->SetMarkerStyle(21);
withoutHighWeightPt->SetMarkerColor(kBlue);
THStack *hs = new THStack("pt stack","");
hs->Add(highWeightPt);
hs->Add(withoutHighWeightPt);
TCanvas *cs = new TCanvas("cs","cs",10,10,700,900);
cs->cd();
cs->SetLogy();
TText T; T.SetTextFont(42); T.SetTextAlign(21);
cs->Divide(2,2);
cs->cd(1); gPad-> SetLogy(); hs->Draw(); T.DrawTextNDC(.5,.95,"Default drawing option");
cs->cd(2); gPad-> SetLogy(); hs->Draw("nostack"); T.DrawTextNDC(.5,.95,"Option \"nostack\"");
cs->cd(3); gPad-> SetLogy(); hs->Draw("nostackb"); T.DrawTextNDC(.5,.95,"Option \"nostackb\"");
cs->cd(4);gPad-> SetLogy(); hs->Draw("lego1"); T.DrawTextNDC(.5,.95,"Option \"lego1\"");
cs->Draw();
cs->Write();
cs->Print("StackPt.pdf", "pdf");
TCanvas *cst = new TCanvas("cst","stacked hists",10,10,700,700);
// cst->SetLogy();
cst->Divide(2,2);
// in top left pad, draw the stack with defaults
cst->cd(1);
gPad-> SetLogy();
hs->Draw();
// in top right pad, draw the stack in non-stack mode
// and errors option
cst->cd(2);
gPad-> SetLogy();
gPad->SetGrid();
hs->Draw("nostack,e1p");
//in bottom left, draw in stack mode with "lego1" option
cst->cd(3);
gPad-> SetLogy();
gPad->SetFrameFillColor(17);
gPad->SetTheta(3.77);
gPad->SetPhi(2.9);
hs->Draw("lego1");
The top right and bottom left plots are what I would expect from these pt plots on the log scale, showing all the way up to 7000 on the x-axis.
I may just be misunderstanding what it is I’ve actually told root to plot, but I’m very confused by the differences here, does anyone know why two of the log scale plots are so compressed in x?
Thanks for any help
__
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided