|
4327 | 4327 | if (l!=-1) { |
4328 | 4328 | var name = 'COL'; |
4329 | 4329 |
|
| 4330 | + if (chopt.charAt(l+3)=='0') { option.Color = 111; name += "0"; l++; } else |
4330 | 4331 | if (chopt.charAt(l+3)=='1') { option.Color = 1; name += "1"; l++; } else |
4331 | 4332 | if (chopt.charAt(l+3)=='2') { option.Color = 2; name += "2"; l++; } else |
4332 | 4333 | if (chopt.charAt(l+3)=='3') { option.Color = 3; name += "3"; l++; } else |
|
6548 | 6549 |
|
6549 | 6550 | JSROOT.TH2Painter.prototype.FillContextMenu = function(menu) { |
6550 | 6551 | JSROOT.THistPainter.prototype.FillContextMenu.call(this, menu); |
6551 | | - menu.add("Auto zoom-in", function() { this.AutoZoom(); }); |
6552 | | - menu.add("Draw in 3D", function() { this.Draw3D(); }); |
| 6552 | + menu.add("Auto zoom-in", this.AutoZoom().bind(this)); |
| 6553 | + menu.add("Draw in 3D", this.Draw3D().bind(this)); |
6553 | 6554 | menu.add("Toggle col", function() { |
6554 | 6555 | if (this.options.Color == 0) |
6555 | 6556 | this.options.Color = JSROOT.gStyle.DefaultCol; |
|
6559 | 6560 | }); |
6560 | 6561 |
|
6561 | 6562 | if (this.options.Color > 0) |
6562 | | - menu.add("Toggle colz", function() { this.ToggleColz(); }); |
| 6563 | + menu.add("Toggle colz", this.ToggleColz().bind(this)); |
6563 | 6564 | } |
6564 | 6565 |
|
6565 | 6566 | JSROOT.TH2Painter.prototype.FindPalette = function(remove) { |
|
6947 | 6948 | color = Math.floor(0.01+(zc-this.zmin)*(this.fContour.length-1)/(this.zmax-this.zmin)); |
6948 | 6949 | } |
6949 | 6950 |
|
| 6951 | + if (color<0) { |
6950 | 6952 | // do not draw bin where color is negative |
6951 | | - if (color<0) return null; |
| 6953 | + if (this.options.Color != 111) return null; |
| 6954 | + color = 0; |
| 6955 | + } |
6952 | 6956 |
|
6953 | 6957 | var palette = JSROOT.gStyle.GetColorPalette(); |
6954 | 6958 | var theColor = Math.floor((color+0.99)*palette.length/(this.fContour.length-1)); |
|
7011 | 7015 | if (gry1 < 0) gry1 = this.gry(y1); |
7012 | 7016 | gry2 = this.gry(y2); |
7013 | 7017 |
|
7014 | | - |
7015 | 7018 | binz = this.histo.getBinContent(i + 1, j + 1); |
7016 | 7019 | if ((binz == 0) || (binz < this.minbin)) continue; |
7017 | 7020 |
|
|
9612 | 9615 | JSROOT.addDrawFunc({ name: "TPaveLabel", func:JSROOT.Painter.drawText }); |
9613 | 9616 | JSROOT.addDrawFunc({ name: /^TH1/, icon: "img_histo1d", func:JSROOT.Painter.drawHistogram1D, opt:";P;P0;E;E1;E2;same"}); |
9614 | 9617 | JSROOT.addDrawFunc({ name: "TProfile", icon: "img_profile", func:JSROOT.Painter.drawHistogram1D, opt:";E0;E1;E2;p;hist"}); |
9615 | | - JSROOT.addDrawFunc({ name: /^TH2/, icon: "img_histo2d", func:JSROOT.Painter.drawHistogram2D, opt:";COL;COLZ;COL3;LEGO;same" }); |
| 9618 | + JSROOT.addDrawFunc({ name: /^TH2/, icon: "img_histo2d", func:JSROOT.Painter.drawHistogram2D, opt:";COL;COLZ;COL0Z;COL3;LEGO;same" }); |
9616 | 9619 | JSROOT.addDrawFunc({ name: /^TH3/, icon: 'img_histo3d', prereq: "3d", func: "JSROOT.Painter.drawHistogram3D" }); |
9617 | 9620 | JSROOT.addDrawFunc({ name: "THStack", func:JSROOT.Painter.drawHStack }); |
9618 | 9621 | JSROOT.addDrawFunc({ name: "TF1", icon: "img_graph", func:JSROOT.Painter.drawFunction }); |
|
0 commit comments