Hi,
I’m using the “COLZ” option to plot a TH2D that has both positive and negative entries. Many entries are also zero. I would like to plot only nonzero entries and have empty bins show up as white. This is the default behavior for histograms with only non-negative entries. I’m hoping there is an easy way to get this behavior also for histograms with some negative entries.
Messing around with color palettes and SetContour hasn’t gotten my anywhere because the histograms are such that I can’t assume much about the entries. In particular, they are not symmetric around zero. I also tried calling gPad->PaintBox() to manually paint empty regions white like I saw it done in THistPainter::PaintColorLevels(), but my calls to PaintBox don’t seem to do anything. My attempt at a function to “whiteout” empty bins for a histogram that was just plotted is attached. Perhaps someone can tell me what’s wrong with it.
I’m using ROOT 5.34. Thanks in advance!
//
Anders
whiteOut.cpp (648 Bytes)