We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8852858 commit a115563Copy full SHA for a115563
modules/gpad/TAxisPainter.mjs
@@ -558,8 +558,9 @@ class TAxisPainter extends ObjectPainter {
558
formatLabels(d) {
559
let indx = parseFloat(d), a = this.getObject();
560
if (!this.regular_labels)
561
- indx = (indx - a.fXmin)/(a.fXmax - a.fXmin) * a.fNbins;
562
- indx = Math.floor(indx);
+ indx = Math.round((indx - a.fXmin)/(a.fXmax - a.fXmin) * a.fNbins);
+ else
563
+ indx = Math.floor(indx);
564
if ((indx < 0) || (indx >= a.fNbins)) return null;
565
for (let i = 0; i < a.fLabels.arr.length; ++i) {
566
let tstr = a.fLabels.arr[i];
0 commit comments