Skip to content

Commit fb679bf

Browse files
ferdymercurydpiparo
authored andcommitted
[hist] paint TH2 even if nEntries==0, as already happens for TH1
Fixes root-project#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.
1 parent 078cf6c commit fb679bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hist/histpainter/src/THistPainter.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9663,7 +9663,7 @@ void THistPainter::PaintTable(Option_t *option)
96639663
if (Hoption.Text) PaintTH2PolyText(option);
96649664
if (Hoption.Line) PaintTH2PolyBins("l");
96659665
if (Hoption.Mark) PaintTH2PolyBins("P");
9666-
} else if (fH->GetEntries() != 0 && Hoption.Axis<=0) {
9666+
} else if (Hoption.Axis<=0) {
96679667
if (Hoption.Scat) PaintScatterPlot(option);
96689668
if (Hoption.Arrow) PaintArrows(option);
96699669
if (Hoption.Box) PaintBoxes(option);

0 commit comments

Comments
 (0)