Drawing TProfile but not the bins containing zero

Hello,

Can a TProfile be convinced to draw only the non-zero entries?
I think draw option “P” should do it (“Draw current marker at each bin except empty bins”), but in the empty bins (= bins containing a zero) it draws a horizontal line at y=0.
This is what I want to get rid of, the horizontal line at 0.
I attached the plot that I’m trying to modify.

Thanks,

Paul

Paul,

Empty bins in a TProfile are not drawn.
You see an horizonthal line for non-empty bins, but with a null error.

Rene

Hi,

The bins where I see a horizontal line have value 0 with error 0, but also 0 entries. Below I obtained the value for x=0.19 (which is in a bin that shows a horizontal line).

root [37] p->GetBinContent(24)
(const Stat_t)0.00000000000000000e+00
root [38] p->GetBinEntries(24)
(const Stat_t)0.00000000000000000e+00
root [39] p->GetBinError(24)
(const Stat_t)0.00000000000000000e+00

I would like not to see anything in this bin, as there were no entries at this x in the TH2F that I used to get the TProfile. And I think you just told me nothing should be drawn in a bin like this. Clearly I see something else…

I’m using root 3.05/04 on RH 7.3. If this turns out to fixed in a more recent version also, I promise I’ll upgrade. :confused:

Thanks,

Paul

I cannot reproduce this problem. See, eg, TProfile “hprof” in hsimple.root
Could you send me a short script showing the problem?

Rene

Hi Rene,

OK, I’m getting a new version.
I did reproduce this using hsimple.cxx in my version, but it turns out to be solved in 3.10/01.

Sorry for bothering you with this- I am getting a newer version now.

Paul

On a positive note, lots of improvement since 3.05/04!