From 7e0f82adeb177594821a8112f0bcb6e35206125b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sat, 15 Nov 2025 17:29:38 +0100 Subject: [PATCH 1/3] [nfc] fix typo in docu --- hist/hist/src/TScatter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hist/hist/src/TScatter.cxx b/hist/hist/src/TScatter.cxx index e8f6e9a81ccb6..dfec152176360 100644 --- a/hist/hist/src/TScatter.cxx +++ b/hist/hist/src/TScatter.cxx @@ -157,7 +157,7 @@ TH2F *TScatter::GetHistogram() const { if (!fHistogram) { // do not add the histogram to gDirectory - // use local TDirectory::TContect that will set temporarly gDirectory to a nullptr and + // use local TDirectory::TContext that will set temporarly gDirectory to a nullptr and // will avoid that histogram is added in the global directory TDirectory::TContext ctx(nullptr); double rwxmin, rwymin, rwxmax, rwymax; From 1e040cde6904f8445f2ed4ed7a5f939bb2619eec Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sat, 15 Nov 2025 18:18:02 +0100 Subject: [PATCH 2/3] [hist] use same n contours for background histogram Fixes https://github.com/root-project/root/issues/20436 --- hist/histpainter/src/TGraphPainter.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/hist/histpainter/src/TGraphPainter.cxx b/hist/histpainter/src/TGraphPainter.cxx index bab7b44ad63ff..48be97d5669f4 100644 --- a/hist/histpainter/src/TGraphPainter.cxx +++ b/hist/histpainter/src/TGraphPainter.cxx @@ -4474,6 +4474,7 @@ void TGraphPainter::PaintScatter(TScatter *theScatter, Option_t* chopt) } TH2F *h = theScatter->GetHistogram(); + h->SetContour(gStyle->GetNumberOfColors()); // Ensure same number of divisions in underlying hist than in TScatter palette if (optionAxis) { h->Paint(" "); if (h->GetMinimum() < h->GetMaximum()) { From c58fd468885d6a49af8f404c842b47f563bfc611 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sat, 15 Nov 2025 18:37:05 +0100 Subject: [PATCH 3/3] [hist] avoid h empty bins to be drawn as background if negative Z values in scatter plot --- hist/histpainter/src/TGraphPainter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hist/histpainter/src/TGraphPainter.cxx b/hist/histpainter/src/TGraphPainter.cxx index 48be97d5669f4..06b0db1a16569 100644 --- a/hist/histpainter/src/TGraphPainter.cxx +++ b/hist/histpainter/src/TGraphPainter.cxx @@ -4476,7 +4476,7 @@ void TGraphPainter::PaintScatter(TScatter *theScatter, Option_t* chopt) TH2F *h = theScatter->GetHistogram(); h->SetContour(gStyle->GetNumberOfColors()); // Ensure same number of divisions in underlying hist than in TScatter palette if (optionAxis) { - h->Paint(" "); + h->Paint("COL1"); // avoid h empty bins to be drawn as background if negative Z values in scatter plot if (h->GetMinimum() < h->GetMaximum()) { if (mincGetMinimum()) minc = h->GetMinimum(); if (maxc>h->GetMaximum()) maxc = h->GetMaximum();