From 2ca95c6cba4bd4e41975f6021ceacbde230a93f7 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 27 Jan 2026 16:49:48 +0100 Subject: [PATCH] Better detect graph hist dflt range #379 Make more precise condition to detect default ranges in the existing histogram --- modules/hist2d/TGraphPainter.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/hist2d/TGraphPainter.mjs b/modules/hist2d/TGraphPainter.mjs index ff486c721..9023e6dbb 100644 --- a/modules/hist2d/TGraphPainter.mjs +++ b/modules/hist2d/TGraphPainter.mjs @@ -75,11 +75,14 @@ class TGraphPainter extends ObjectPainter { return true; let is_normal = false; - if (check_axis !== 'y') - is_normal ||= (histo.fXaxis.fXmin !== 0.0011) || (histo.fXaxis.fXmax !== 1.1); + if (check_axis !== 'y') { + is_normal ||= ((histo.fXaxis.fXmin !== 0.0011) && (histo.fXaxis.fXmin !== 0)) || + ((histo.fXaxis.fXmax !== 1.1) && (histo.fXaxis.fXmax !== 1)); + } if (check_axis !== 'x') { - is_normal ||= (histo.fYaxis.fXmin !== 0.0011) || (histo.fYaxis.fXmax !== 1.1) || + is_normal ||= ((histo.fYaxis.fXmin !== 0.0011) && (histo.fYaxis.fXmin !== 0)) || + ((histo.fYaxis.fXmax !== 1.1) && (histo.fYaxis.fXmax !== 1)) || (histo.fMinimum !== 0.0011) || (histo.fMaximum !== 1.1); }