mkovac
January 17, 2018, 11:13pm
1
Hi,
trying to plot 3 stacked histograms using hbar option. The problem is black histogram boundary line which appears on two stacked histograms and not on the third one. I want to ged rid of this line but nothing I’ve tried helps. SetLineColor method doesn’t help neither, the boundary line simply stays black.
Any ideas? Thanks.
couet
January 18, 2018, 7:32am
2
Can you post you macro ? I will try to modify it to make it work as you wish.
mkovac
January 18, 2018, 8:12am
3
It is a part of larger compiled code, not a standalone macro so I can post a few lines connected with this problem. Thanks.
THStack.cpp (1.8 KB)
couet
January 18, 2018, 8:14am
4
Ok that does not help … I will try to make a reproducer …
couet
January 18, 2018, 8:18am
5
Here it is. I do not see any problem:
{
THStack *hs = new THStack("hs","Stacked 1D histograms");
TH1F *h1st = new TH1F("h1st","test hstack",10,-4,4);
h1st->FillRandom("gaus",20000);
h1st->SetFillColor(kRed);
h1st->SetMarkerStyle(21);
h1st->SetMarkerColor(kRed);
hs->Add(h1st);
TH1F *h2st = new TH1F("h2st","test hstack",10,-4,4);
h2st->FillRandom("gaus",15000);
h2st->SetFillColor(kBlue);
h2st->SetMarkerStyle(21);
h2st->SetMarkerColor(kBlue);
hs->Add(h2st);
TH1F *h3st = new TH1F("h3st","test hstack",10,-4,4);
h3st->FillRandom("gaus",10000);
h3st->SetFillColor(kGreen);
h3st->SetMarkerStyle(21);
h3st->SetMarkerColor(kGreen);
hs->Add(h3st);
hs->Draw("hbar");
}
system
Closed
February 1, 2018, 8:18am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.