|
2482 | 2482 | for (var i=0;i<contour.length-1;++i) { |
2483 | 2483 | var z0 = z(contour[i]); |
2484 | 2484 | var z1 = z(contour[i+1]); |
2485 | | - var col = this.main_painter().getValueColor(contour[i]); |
| 2485 | + var col = this.main_painter().getValueColor((contour[i] + contour[i+1])/2); |
2486 | 2486 |
|
2487 | 2487 | var pnt = { x: 128, width: 256, y: Math.round(z1/h*512) , height: Math.round((z0-z1)/h*512), fill: col }; |
2488 | 2488 |
|
|
2544 | 2544 | for (var i=0;i<contour.length-1;++i) { |
2545 | 2545 | var z0 = z(contour[i]), |
2546 | 2546 | z1 = z(contour[i+1]), |
2547 | | - col = this.main_painter().getValueColor(contour[i]); |
| 2547 | + col = this.main_painter().getValueColor((contour[i]+contour[i+1])/2); |
2548 | 2548 |
|
2549 | 2549 | var r = this.draw_g.append("svg:rect") |
2550 | 2550 | .attr("x", 0) |
|
3132 | 3132 | return l; |
3133 | 3133 | } |
3134 | 3134 |
|
| 3135 | + // bins less than zmin not drawn |
| 3136 | + if (zc < this.zmin) return -111; |
| 3137 | + |
| 3138 | + // if bin content exactly zmin, draw it when col0 specified or when content is positive |
| 3139 | + if (zc===this.zmin) return ((this.zmin > 0) || (this.options.Color === 111)) ? 0 : -1; |
| 3140 | + |
3135 | 3141 | return Math.floor(0.01+(zc-this.zmin)*(this.fContour.length-1)/(this.zmax-this.zmin)); |
3136 | 3142 | } |
3137 | 3143 |
|
3138 | 3144 | JSROOT.TH2Painter.prototype.getValueColor = function(zc, asindx) { |
3139 | 3145 | var index = this.getContourIndex(zc); |
3140 | 3146 |
|
3141 | | - if (index<0) { |
3142 | | - // do not draw bin where color is negative, only with col0 option minimal values are shown |
3143 | | - if (this.options.Color !== 111) return null; |
3144 | | - index = 0; |
3145 | | - } |
| 3147 | + if (index<0) return null; |
3146 | 3148 |
|
3147 | 3149 | if (this.fPalette == null) |
3148 | 3150 | this.fPalette = JSROOT.Painter.GetColorPalette(this.options.Palette); |
|
3430 | 3432 | for (i = handle.i1; i < handle.i2; ++i) { |
3431 | 3433 | for (j = handle.j1; j < handle.j2; ++j) { |
3432 | 3434 | binz = histo.getBinContent(i + 1, j + 1); |
3433 | | - if ((binz == 0) || (binz < this.minbin)) continue; |
| 3435 | + //if ((binz == 0) || (binz < this.minbin)) continue; |
3434 | 3436 |
|
3435 | 3437 | colindx = this.getValueColor(binz, true); |
3436 | 3438 | if (colindx === null) continue; |
|
3478 | 3480 | for (i = handle.i1; i < handle.i2; ++i) |
3479 | 3481 | for (j = handle.j1; j < handle.j2; ++j) { |
3480 | 3482 | binz = histo.getBinContent(i + 1, j + 1); |
3481 | | - if ((binz == 0) || (binz < this.minbin)) continue; |
| 3483 | + //if ((binz == 0) || (binz < this.minbin)) continue; |
3482 | 3484 |
|
3483 | 3485 | colindx = this.getValueColor(binz, true); |
3484 | 3486 | if (colindx === null) continue; |
|
0 commit comments