Dear Rene,
Please see the attachments.
Thanks,
Aamer
Could you post a short macro implementing my way and the small data file containing your histogram?
Rene
On 04/09/2011 14:26, Aamer Wali Rauf wrote: Dear Rene,
I tried it, but it did not work for me. I exactly followed your instructions. I must mention that the original histogram I extracted from TList if histograms in TDirectoryFile in TFile. I don't think that should make any difference to how I get to the first instruction in your set.
Regards,
Aamer
Assuming TH1* h,
left band from bins 1 to bl
right band bins from br to nbins
signal band bins from sl to sr
do:
h->Draw();
TH1 *hleft = (TH1*)h->Clone("hleft");
hleft->GetXaxis()->SetRange(1,bl); hleft->SetFillColor(color of left band); hleft->Draw("same");
hright->GetXaxis()->SetRange(br,nbins); hright->SetFillColor(color of right band); hright->Draw("same");
hsig->GetXaxis()->SetRange(sl,sr); hsig->SetFillColor(color of signal band); hsig->Draw("same");
Rene
On 03/09/2011 13:37, Aamer Wali Rauf wrote: Hi,
Is there any way I can shade different parts of the histogram with different colours. What I want to do is to show the left background band, the right background band and the band around the signal. I want to have these three windows shaded different just for illustration.Thanks, Aamer
This archive was generated by hypermail 2.2.0 : Sun Sep 04 2011 - 17:50:01 CEST