Histogram with different bin sizes?

Hi,

how can I construct a histogram with different bin sizes.
For exeample a histogram from 0. to 7. with three bins with the first bin (0.,1.5), the secon (1.5,4.) and the third (4.,7.). I tried something like:

Double_t Bin[4] = {0.,1.5,4.,7.}
TH1D *histo = new TH1D(“histo”,“histo”,3,Bin,0.,7.)

But that does not seem to work. Maybe somebody can give me a hint.
Thanks,
Thomas

Hi Thomas,
use

Double_t Bin[4] = {0.,1.5,4.,7.}; TH1D *histo = new TH1D("histo","histo;x-axis title;y-axis title",3,Bin);
See root.cern.ch/root/html/TH1D.html for the available constructors.
Axel.

Thanks :slight_smile: