Skip to content

Conversation

@ferdymercury
Copy link
Collaborator

@ferdymercury ferdymercury commented Jan 28, 2025

This Pull request:

Changes or fixes:

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 for the 2D case, for consistency.

Fixes #14153

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

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.
@github-actions
Copy link

Test Results

    18 files      18 suites   3d 23h 14m 23s ⏱️
 2 683 tests  2 682 ✅ 0 💤 1 ❌
46 598 runs  46 597 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit cc21998.

Copy link
Member

@couet couet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it makes sense to me. I do not have in mind some possible side effects.

@dpiparo dpiparo merged commit fb679bf into root-project:master Jan 31, 2025
18 of 21 checks passed
@ferdymercury ferdymercury deleted the zeroentries branch January 31, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TH2 not drawn if only TH2::AddBinContent is called (Entries=0). For TH1 it works.

3 participants