Re: separate contant of each bin in a histogram

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 26 1998 - 16:50:21 MEST


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



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:36 MET