Re: separate contant of each bin in a histogram

Rene Brun (Rene.Brun@cern.ch)
Wed, 26 Aug 1998 16:50:21 +0200


Wei Xie wrote:
>
> Dear Rooters,
>
> Assuming a histogram contain the distribution of
> dN/dX vs. X. The center value of each bin is
> X = 1, 2, 3, 4, e.g.
>
> ^ |-|
> | |-| | |
> | | |-| |
> | |-| | | |
> | | | | | |
> | | | | | |
> ---------------->X
> 0 1 2 3 4
>
> My problem is I do not want the square in each bin connected with
> each other, that means I want the histogram looks like followed:
>
> ^ |-|
> | |-| | |
> | | | |-| | |
> | |-| | | | | | |
> | | | | | | | | |
> | | | | | | | | |
> ---------------------------->X
> 0 1 2 3 4
>

This is possible using the "bar chart" option.
You can do
h.Draw("b")
You can select the bar offset and bar width respectively via
h.SetBarOffset(offset)
h.SetBarWidth(width)

You can fill the bars with the histogram fill color via
h.SetFillColor(color)

Rene Brun