Skip to content

Commit 7c76ff7

Browse files
committed
Fix - use error plot by default in TH1 only when positive sumw2 entry
exists
1 parent cd816d4 commit 7c76ff7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
1. Fix - wrong selection of TH1 Y axis range when errors are displayed (#44)
55
2. Fix - apply user range for TH1 X-axis zooming (#44)
66
3. Fix - protect against patalogic case of 1-bin histogram
7+
4. Fix - use error plot by default in TH1 only when positive sumw2 entry exists
78

89

910
## Changes in 4.4.2

scripts/JSRootPainter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,7 +3847,11 @@
38473847

38483848
// if (hdim > 1) option.Scat = 1; // default was scatter plot
38493849

3850-
if ((hdim===1) && (this.histo.fSumw2.length > 0)) option.Error = 2;
3850+
// use error plot only when any sumw2 bigger than 0
3851+
if ((hdim===1) && (this.histo.fSumw2.length > 0))
3852+
for (var n=0;n<this.histo.fSumw2.length;++n)
3853+
if (this.histo.fSumw2[n] > 0) { option.Error = 2; break; }
3854+
38513855
if (this.histo.fFunctions !== null) option.Func = 1;
38523856

38533857
var i = chopt.indexOf('PAL');
@@ -8460,7 +8464,7 @@
84608464
JSROOT.addDrawFunc({ name: "TLatex", icon:"img_text", func: JSROOT.Painter.drawText });
84618465
JSROOT.addDrawFunc({ name: "TMathText", icon:"img_text", func: JSROOT.Painter.drawText });
84628466
JSROOT.addDrawFunc({ name: "TText", icon:"img_text", func: JSROOT.Painter.drawText });
8463-
JSROOT.addDrawFunc({ name: /^TH1/, icon: "img_histo1d", func: JSROOT.Painter.drawHistogram1D, opt:";P;P0;E;E1;E2;same"});
8467+
JSROOT.addDrawFunc({ name: /^TH1/, icon: "img_histo1d", func: JSROOT.Painter.drawHistogram1D, opt:";HIST;P;P0;E;E1;E2;same"});
84648468
JSROOT.addDrawFunc({ name: "TProfile", icon: "img_profile", func: JSROOT.Painter.drawHistogram1D, opt:";E0;E1;E2;p;hist"});
84658469
JSROOT.addDrawFunc({ name: /^TH2/, icon: "img_histo2d", prereq: "more2d", func: "JSROOT.Painter.drawHistogram2D", opt:";COL;COLZ;COL0Z;BOX;SCAT;TEXT;LEGO;same" });
84668470
JSROOT.addDrawFunc({ name: /^TH3/, icon: 'img_histo3d', prereq: "3d", func: "JSROOT.Painter.drawHistogram3D" });

0 commit comments

Comments
 (0)