Skip to content

Commit e04b538

Browse files
committed
Show bins index in projection hist title
1 parent cb3ec9a commit e04b538

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/JSRoot.hist.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4702,13 +4702,16 @@ JSROOT.define(['d3', 'painter', 'gpad'], (d3, jsrp) => {
47024702
for (let j = jj1; j < jj2; ++j) sum += histo.getBinContent(i+1,j+1);
47034703
this.proj_hist.setBinContent(i+1, sum);
47044704
}
4705+
this.proj_hist.fTitle = "X projection " + (jj1+1 == jj2 ? `bin ${jj2}` : `bins [${jj1+1} .. ${jj2}]`);
47054706
if (this.tt_handle) { first = this.tt_handle.i1+1; last = this.tt_handle.i2; }
4707+
47064708
} else {
47074709
for (let j = 0; j < this.nbinsy; ++j) {
47084710
let sum = 0;
47094711
for (let i = ii1; i < ii2; ++i) sum += histo.getBinContent(i+1,j+1);
47104712
this.proj_hist.setBinContent(j+1, sum);
47114713
}
4714+
this.proj_hist.fTitle = "Y projection " + (ii1+1 == ii2 ? `bin ${ii2}` : `bins [${ii1+1} .. ${ii2}]`);
47124715
if (this.tt_handle) { first = this.tt_handle.j1+1; last = this.tt_handle.j2; }
47134716
}
47144717

0 commit comments

Comments
 (0)