Re: drawing exclusion area in histograms

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Fri, 20 Nov 2009 18:46:10 +0100


Simply do like in the following example

Root [0] hpx.Draw()
Root [1] TH1 *h2 = hpx->DrawCopy("same")
Root [2] h2->GetXaxis()->SetRange(34,56)
Root [3] h2->SetFillColor(kRed)

Rene Brun

Brett Viren wrote:
> Stephan Zimmer <zimmerst_at_googlemail.com> writes:
>
>
>> I have a histogram (no tree!) and I want to draw an exclusion area.
>>
>
> Try this:
>
> - Copy the original histogram into a new object
>
> - zero out all bins of the copy except the ones defining your
> "exclusion area" using SetBinContent(),
>
> - draw the original histogram,
>
> - call SetFillColor(N) on the copy or otherwise change how it appears
>
> - draw the copy on top of the original by calling Draw() with the
> "SAME" option.
>
> -Brett.
>
>
Received on Fri Nov 20 2009 - 18:46:13 CET

This archive was generated by hypermail 2.2.0 : Mon Nov 23 2009 - 11:50:04 CET