Bar histogram

Hi!

I need to draw a bar histogram with positive and negative values on ax Y. Something like in example hbars.C (from tutorials), but with positive and negative values.
If I specify minimal value (SetMinimum) for TH1F then all bars are drown from minimal value up to the specified value, but I want to draw them from zero up to specified value (positive or negative).
Please could somebody help me?

Thanks,
	Linda

p.s.
I am newbie in root, so please forgive me if this is a stupid question.

Can you try:

gStyle->SetHistMinimumZero(kTRUE);

Hi!

Tanks for such a fast replay, but it is not working.

I’m sending a cod example. Maybe it will help to discover a problem, a bit faster.

Linda
bar_hist.C (1.18 KB)

Yes… I see… it does not work with the option BAR. Try a simple Draw()(without oprion bar) and you will get what you want.

Yes, it is true, but then each bar is of the bin size.
And I would like to have separate bars in one bin. :frowning:

It is now implemented in the CVS head.

Hi!

I checked and installed new source trough CVS, but the figure I got in the moment is still not OK? It is attached. Am I doing something wrong?

Linda

I think you do not have the latest fix I did. With my fix your macro produces the attached picture.
See root.cern.ch/viewcvs/histpainter … ainter.cxx


It is working now :smiley:

Tanks!