THStack::Draw( "pfc nostack" ) does not work properly

I use the following example of using THStack with automatic coloring:

void thstackpalettecolor()
{
   THStack *hs = new THStack("hs","Stacked 1D histograms colored using kOcean palette");
   gStyle->SetPalette(kOcean);
   // Create three 1-d histograms  and add them in the stack
   TH1F *h1st = new TH1F("h1st","test hstack",100,-4,4);
   h1st->FillRandom("gaus",20000);
   hs->Add(h1st);
   TH1F *h2st = new TH1F("h2st","test hstack",100,-4,4);
   h2st->FillRandom("gaus",15000);
   hs->Add(h2st);
   TH1F *h3st = new TH1F("h3st","test hstack",100,-4,4);
   h3st->FillRandom("gaus",10000);
   hs->Add(h3st);
   // draw the stack
   hs->Draw("pfc nostack");
}

But instead of beautiful picture (the first one) I get something really ugly (the second one). What the problem?
screenshot-20180323-15%3A50%3A36


ROOT Version (e.g. 6.12/02): 6.08/02
Platform, compiler (e.g. CentOS 7.3, gcc6.2): Ubuntu 14.04


As said here this feature was implemented in ROOT 6.09/01. Your ROOT version is too old.

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