Skip to content

Commit 396f3b9

Browse files
committed
Fix - properly check axis bins
1 parent 19fc51a commit 396f3b9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/hist/THStackPainter.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ class THStackPainter extends ObjectPainter {
4242
lst.Add(clone(stack.fHists.arr[0]), stack.fHists.opt[0]);
4343
for (let i = 1; i < nhists; ++i) {
4444
const hnext = clone(stack.fHists.arr[i]),
45-
hnextopt = stack.fHists.opt[i],
46-
hprev = lst.arr[i-1];
45+
hnextopt = stack.fHists.opt[i],
46+
hprev = lst.arr[i-1],
47+
xnext = hnext.fXaxis, xprev = hprev.fXaxis;
4748

48-
if ((hnext.fNbins !== hprev.fNbins) ||
49-
(hnext.fXaxis.fXmin !== hprev.fXaxis.fXmin) ||
50-
(hnext.fXaxis.fXmax !== hprev.fXaxis.fXmax)) {
49+
if ((xnext.fNbins !== xprev.fNbins) ||
50+
(xnext.fXmin !== xprev.fXmin) ||
51+
(xnext.fXmax !== xprev.fXmax)) {
5152
console.warn(`When drawing THStack, cannot sum-up histograms ${hnext.fName} and ${hprev.fName}`);
5253
lst.Clear();
5354
return false;

0 commit comments

Comments
 (0)