How to plot the bigger histograms behind all the others

Dear experts,

I am having a problem in my code where some histograms are plotted behind the “bigger” histograms, so they just don’t show up in the plot. There is any tool in root to make sure the “little” histograms are plotted last and so, will show in the plot?

I know that if you just do Draw in the bigger histograms first, they will eventually be plotted first. But i am reading the histograms from a file, and sort it by hand would be very tedious.

So, i would appreciate any help.

Best regards,

Several ways:

  1. Use a THStack. The histograms in the stack are plotted in the order you added them in the stack. The first added is plotted first etc … Then you can check the maximum of each histogram and put them in the stack in the right order
  2. Instead of drawing the histogram as filled areas draw them as lines. The order doesn’t not matter in that can.
  3. Draw the histogram as filled areas but not solid… use hatches. It might be a bit cluttered though…
  4. Draw the histograms as filled areas but use transparent colours (it does not work on all platform though)
  5. Draw them using option “SAME” in the order defined at 1.
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.