I have a file with histograms. On some of them I get this error when I try to draw them:
root [81] h->Draw()
Warning in TCanvas::ResizePad: Inf/NaN propagated to the pad. Check drawn objects.
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10
I guess this error has something to do with the histrogram trying to set the height of the pad to a NaN or Inf value and so the height is set to a default range.
I looking for insight as to what is the source of this error. I guess there must have been some error in filling the histogram - perhaps a Nan value was filled? When I examine the bin content, and mean of the histogram the data look reasonable.
I’m also interested in how I might be able to detect this error without having to try to draw the histogram. Is there some histogram method I can put in a script which would return some error value if there is some problem with the histogram such that it cannot be drawn?
I have attached a file with a bad histogram in it - has nan’s somewhere so that it will not plot.
I’d like to know where the nan’s are and how to detect them (in a root script). nan_hist.root (6.95 KB)
Thanks for finding my problem. Obviously, the program which generates these histograms should not be filling them with nan’s. I will have to fix that.