Skip to content
Snippets Groups Projects
Commit 7026fbd2 authored by Olivier Couet's avatar Olivier Couet
Browse files

- The modification done in Revision 1.13 to paint the top of a THStack with

  the right color was not working properly in certain cases when there was
  more than 3 histograms in the stack: specifically if in a given bin only
  one of the histograms is non-empty, then the top of that bin was wrongly
  colored with the color of the lowest element of the stack.
  This patch fixes this problem. This problem could be seen with the
  following example:

  void test_lego_stack () {
    TH2F * h1 = new TH2F("h1","h1",5,0,6,5,-4,4);
    TH2F * h2 = new TH2F("h2","h1",5,0,6,5,-4,4);
    TH2F * h3 = new TH2F("h3","h1",5,0,6,5,-4,4);
    TH2F * h4 = new TH2F("h4","h1",5,0,6,5,-4,4);
    TH2F * h5 = new TH2F("h5","h1",5,0,6,5,-4,4);
    h1->SetFillColor(1); // grey
    h2->SetFillColor(2); // red
    h3->SetFillColor(3); // green
    h4->SetFillColor(4); // blue
    h5->SetFillColor(5); // yellow
    h2->Fill(2,0,11);
    h3->Fill(3,0,12);
    h4->Fill(4,0,13);
    h5->Fill(5,0,14);
    THStack * hs = new THStack("hs","test of stack");
    hs->Add(h1);
    hs->Add(h2);
    hs->Add(h3);
    hs->Add(h4);
    hs->Add(h5);
    hs->Draw("lego1");
  }


git-svn-id: http://root.cern.ch/svn/root/trunk@14094 27541ba8-7e3a-0410-8455-c3a389f83636
parent 57965610
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment