Drawing histgram - forcing last vertical line to get drawn

How do I force the last vertical line to get drawn. See attached .root file. Here’ the script that draws histos:

{ TCanvas *pc =new TCanvas("pc"); pc->SetLogx(1); pc->SetLogy(1); TFile *f = new TFile("example.root"); pSize->Draw(); pSize->SetMinimum(1.e-7); pRandom->Draw("hist same"); }

thanks! I’m using win32gdk 4.10/8. Same behavior w/ 3.10/2…

Ed
example.root (5.96 KB)


Hi Ed,

The last and first lines are not drawn to avoid the overlap with the frame because it doesn’t look nice when the histrogram line attributes differ from the frame line attributes (I guess). But in a case like yours they surely can be drawn because they do not overlap the frame. I’ ll check how to improve that (It may takes a bit of time to be sure there is no unwanted side effects). For now, I may suggest you a workaround:

{
   TCanvas *pc =new TCanvas("pc");
   pc->SetLogx(1);
   pc->SetLogy(1);
   TFile *f = new TFile("example.root");
   pSize->SetMinimum(1.e-7);
   pSize->Draw("");
   pRandom->Draw("hist same");
   pRandom->SetFillStyle(3003);
   pRandom->SetFillColor(1);  
   pRandom->SetLineColor(0);
}

Olivier