Skip to content

Histograms containing NaN can't be drawn. #23125

Closed

Description

@hageboeck

When NaN ends up in a histogram, you can't draw it. This should not stop us from fixing the TTreeFormula issue. Instead, we should devise a strategy to draw the histogram as best as we can, and putting a placeholder into the bins that contain NaN.

Originally posted by @hageboeck in #22756 (comment)

Activity

  1. hageboeck commented on Aug 21, 2026

    @hageboeck
    MemberAuthor
    root [0] TH1D histo("histo", "histo", 10, 0, 10);
    root [2] histo.SetBinContent(1, std::sqrt(-1));
    root [3] histo.Fill(3)
    root [4] histo.Draw()
    Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
    Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
    Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10
    
  2. self-assigned this
    on Aug 21, 2026
  3. ferdymercury commented on Aug 21, 2026

    @ferdymercury
    Collaborator

    putting a placeholder into the bins that contain NaN.

    Related discussion, it seems that with TTree Draw it works fine and the NaNs end up in the overflow bin #22756 (comment) but not with histograms where the content of a bin itself is NaN (in contrast to the x value being nan).

  4. github-actions commented on Aug 27, 2026

    @github-actions

    Hi @dpiparo, @hageboeck,

    It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

    Sincerely,
    🤖

  5. github-actions commented on Aug 28, 2026

    @github-actions

    Hi @dpiparo, @hageboeck,

    It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

    Sincerely,
    🤖

  6. github-actions commented on Aug 31, 2026

    @github-actions

    Hi @dpiparo, @hageboeck,

    It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

    Sincerely,
    🤖

  7. github-actions commented on Sep 1, 2026

    @github-actions

    Hi @dpiparo, @hageboeck,

    It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

    Sincerely,
    🤖

  8. github-actions commented on Sep 2, 2026

    @github-actions

    Hi @dpiparo, @hageboeck,

    It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

    Sincerely,
    🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions