Plot histograms with fill patterns on top of each other

Hi,

I’m trying to do something fairly simple, but somehow I’m stuck. I’m trying to plot a few histograms on top of each other. The first one covers the most area, the second one covers less, the third one even less, and so on.

Since the result has to look good in B&W, I can’t just use solid colours for them. (Well, I decided to use a solid filling for the first one actually…)

In good ol’ PAW times, one had to plot each new histogram twice in such a case. Once with a solid white filling to cover up the histogram(s) that came before, then with it’s “normal” filling.

But if I do this, the solid white cover doesn’t stay plotted after I plot the histogram a second time. So in the result EPS I see that the histogram gets drawn with its hatch style twice, instead of being drawn first with a white filling, then with its hatch style.

I’m sure this has to work somehow, but I couldn’t figure out how. Any help much appreciated.

Cheers,
Attila

May be you can used stacked histograms as is the example:
$ROOTSYS/tutorials/hist/hstack.C

PS: Sorry for the very late answer.

Hi,

You’re right, I should’ve tried histogram stacks. In the end I solved the issue by using fill patterns that complemented each other. (I only had 3 histograms in the end.)

Besides, I just realised that what I initially thought of, can also be done using: TH1::DrawCopy(). This allows to draw the same histogram multiple times with different styles, so the “paw method” for drawing the histograms can also be made to work.

Cheers,
Attila

Yes, that’s an other way.