# 2D histograms with "col" option

**URL:** <https://root-forum.cern.ch/t/2d-histograms-with-col-option/18603>\
**Category:** ROOT\
**Created:** [December 11, 2014, 4:20pm UTC](https://root-forum.cern.ch/t/2d-histograms-with-col-option/18603 "2014-12-11T16:20:13Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![delaossa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/delaossa/32/12319_2.png) [@delaossa](https://root-forum.cern.ch/u/delaossa)\
**Post date:** [December 12, 2014, 3:08pm UTC](https://root-forum.cern.ch/t/2d-histograms-with-col-option/18603/6 "2014-12-12T15:08:04Z")

</div>

OK, I patched THistPainter.cxx myself to do this.  
Now, if I do just Draw(“colz”) the behaviour is the usual: bins with z\<zmin are not painted.  
But if I do Draw(“colz0”) they are!  
Here is the result in my plot:

 ![](https://root-forum.cern.ch/uploads/default/original/2X/3/326a5ffaf197d77aa0a7b736ecccd2671e7e417f.png)  
  
So I am happy!

Just to let you know I edited the following lines in THistPainter.cxx

` l = strstr(chopt,"COLZ");
   if (l) {
      strncpy(l," ",4);
      if (hdim>1) {
         Hoption.Color = 2;
         Hoption.Scat = 0;
         Hoption.Zscale = 1;
	 if(strstr(chopt,"0"))
	   Hoption.Zero = 1;
      } else {
	Hoption.Hist = 1;
      }
   }
   l = strstr(chopt,"COL" );
   if (l) {
     strncpy(l," ", 3);
     if (hdim>1) {
         Hoption.Color = 1;
         Hoption.Scat = 0;
	 if(strstr(chopt,"0"))
	   Hoption.Zero = 1;
      } else {
         Hoption.Hist = 1;
      }
   }`

Which means that the Hoption.Zero flag is set or not depending on the “0” option.

Then I go to the other line that you pointed out and do:

` if(!Hoption.Zero)
	   if (z < zmin) continue;
`  
So this condition is evaluated only if the flag is not set.  
What do you think?

---

_[View the full topic](https://root-forum.cern.ch/t/2d-histograms-with-col-option/18603)._
