Skip to content

Commit 6c81314

Browse files
committed
Correctly handle logz on lego plots
1 parent 6431ccb commit 6c81314

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

scripts/JSRoot.gpad.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ JSROOT.define(['d3', 'painter'], (d3, jsrp) => {
196196
}
197197
}
198198

199+
/** @summary Return scale min */
200+
TAxisPainter.prototype.getScaleMin = function() {
201+
return this.func ? this.func.domain()[0] : 0;
202+
}
203+
204+
/** @summary Return scale max */
205+
TAxisPainter.prototype.getScaleMax = function() {
206+
return this.func ? this.func.domain()[1] : 0;
207+
}
208+
199209
/** @summary Provide label for axis value */
200210
TAxisPainter.prototype.formatLabels = function(d) {
201211
let indx = parseFloat(d), a = this.getObject();

scripts/JSRoot.hist3d.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,8 @@ JSROOT.define(['d3', 'painter', 'base3d', 'latex', 'hist'], (d3, jsrp, THREE, lt
10441044
// reduced vertices
10451045
rvertices = [ new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, 1, 0), new THREE.Vector3(1, 1, 0), new THREE.Vector3(1, 0, 0) ],
10461046
main = this.getFramePainter(),
1047-
axis_zmin = main.z_handle.gr.domain()[0],
1048-
axis_zmax = main.z_handle.gr.domain()[1],
1047+
axis_zmin = main.z_handle.getScaleMin(),
1048+
axis_zmax = main.z_handle.getScaleMax(),
10491049
zmin, zmax,
10501050
handle = this.prepareColorDraw({ rounding: false, use3d: true, extra: 1 }),
10511051
i1 = handle.i1, i2 = handle.i2, j1 = handle.j1, j2 = handle.j2,
@@ -1570,8 +1570,8 @@ JSROOT.define(['d3', 'painter', 'base3d', 'latex', 'hist'], (d3, jsrp, THREE, lt
15701570
main = this.getFramePainter(),
15711571
handle = this.prepareColorDraw({rounding: false, use3d: true, extra: 1, middle: 0.5 }),
15721572
i,j, x1, y1, x2, y2, z11, z12, z21, z22,
1573-
axis_zmin = main.z_handle.gr.domain()[0];
1574-
// axis_zmax = main.z_handle.gr.domain()[1];
1573+
axis_zmin = main.z_handle.getScaleMin();
1574+
// axis_zmax = main.z_handle.getScaleMax();
15751575

15761576
// first adjust ranges
15771577

@@ -1972,8 +1972,8 @@ JSROOT.define(['d3', 'painter', 'base3d', 'latex', 'hist'], (d3, jsrp, THREE, lt
19721972
let main = this.getFramePainter(),
19731973
histo = this.getHisto(),
19741974
handle = this.prepareColorDraw({ rounding: false, use3d: true, extra: 1 }),
1975-
zmin = main.z_handle.gr.domain()[0],
1976-
zmax = main.z_handle.gr.domain()[1],
1975+
zmin = main.z_handle.getScaleMin(),
1976+
zmax = main.z_handle.getScaleMax(),
19771977
i, j, bin, binz, binerr, x1, y1, x2, y2, z1, z2,
19781978
nsegments = 0, lpos = null, binindx = null, lindx = 0;
19791979

@@ -2076,8 +2076,8 @@ JSROOT.define(['d3', 'painter', 'base3d', 'latex', 'hist'], (d3, jsrp, THREE, lt
20762076
JSROOT.TH2Painter.prototype.drawPolyLego = function() {
20772077
let histo = this.getHisto(),
20782078
pmain = this.getFramePainter(),
2079-
axis_zmin = pmain.z_handle.gr.domain()[0],
2080-
axis_zmax = pmain.z_handle.gr.domain()[1],
2079+
axis_zmin = pmain.z_handle.getScaleMin(),
2080+
axis_zmax = pmain.z_handle.getScaleMax(),
20812081
colindx, bin, i, len = histo.fBins.arr.length,
20822082
z0 = pmain.grz(axis_zmin), z1;
20832083

0 commit comments

Comments
 (0)