From cc21998f52eb454a627f05a7d6f8a3ea3614eb0c Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 28 Jan 2025 17:50:00 +0100 Subject: [PATCH] [hist] paint TH2 even if nEntries==0, as already happens for TH1 Fixes https://github.com/root-project/root/issues/14153 If you fill a TH1 using only AddBinContent, the resulting nEntries=0, and call Draw(), it works. If you fill a TH2 using only AddBinContent, the resulting nEntries=0, and call Draw("COLZ"), it does not work. This commit tries to fix it so that it also works. --- hist/histpainter/src/THistPainter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hist/histpainter/src/THistPainter.cxx b/hist/histpainter/src/THistPainter.cxx index 83b9d3595d4d9..05d7ef95207bd 100644 --- a/hist/histpainter/src/THistPainter.cxx +++ b/hist/histpainter/src/THistPainter.cxx @@ -9663,7 +9663,7 @@ void THistPainter::PaintTable(Option_t *option) if (Hoption.Text) PaintTH2PolyText(option); if (Hoption.Line) PaintTH2PolyBins("l"); if (Hoption.Mark) PaintTH2PolyBins("P"); - } else if (fH->GetEntries() != 0 && Hoption.Axis<=0) { + } else if (Hoption.Axis<=0) { if (Hoption.Scat) PaintScatterPlot(option); if (Hoption.Arrow) PaintArrows(option); if (Hoption.Box) PaintBoxes(option);