Empty bins in surf2 plot option

Hi everybody!
I have a 2D histogram with many empty bins. I would like them to appear white when using a rainbow colour palette. In the z scale I have positive and negative values.
If I use the colz option it is colz1, then I manage to make the empty bins appear white. But I would like to use the option surf2 to make maxima and minima more evident. Is there a way to plot the empty bins as white also in this case ?



In case of surface plot you cannot do that with an option. What you can do if to define your own palette with some specific color (white) at 0.

Thanks for the answer. Is there a tutorial on how to change the Palette ? I was trying this code:

UInt_t Number = 3;
Double_t Red[3] = { 0.00, 0.00, 1.00};
Double_t Green[3] = { 0.00, 1.00, 0.00};
Double_t Blue[3] = { 1.00, 0.00, 1.00};
Double_t Length[3] = { 0.00, 0.50, 1.00 };
Int_t nb=50;

But I could not figure out how to put in white a range of the palette around 0…

Hi! I found
something that works to make the empty point white:

const UInt_t Number = 5;
Double_t Red[Number] = {1.00, 0.00, 1.00, 1.00, 0.00};
Double_t Green[Number] = { 0.00, 1.00, 1.00, 0.00, 0.00};
Double_t Blue[Number] = { 0.00, 0.00, 1.00, 1.00, 1.00};
Double_t Length[Number] = { 0.00, 0.48, 0.52, 0.55, 1.00 };
Int_t nb=50;

// hcol2->SetMaximum(6000);
// hcol2->SetMinimum(-6000);

However, I cannot understand the meaning of the command Double_t Red[Number] = {1.00, 0.00, 1.00, 1.00, 0.00}; Am I defining 5 colours? From the class documentation I cannot understand…

Yes in that case you define the 5 colors for each oh them you specify the value of Red Green and Blue.
And the position (in % on the palette length (Length vector)). You need to figure out when the 0 is. That can easily computed with the Min and Max of the histogram. CreateGradientColorTable then bail the palette for you