# ListPlot3D: make certain data points have a specific color, whilst the rest of the data is coloured

I have a 3D data set and would like to color the ListPlot3D but have all the values equal to zero show up as a single colour. For example, having the non-zero points here stay the same, but the surrounding areas to be gray, for example. Thank you in advance for any advice.

• Change the ColorFunction to be something like With[{cf=ColorData["M10DefaultDensityGradient"]}, If[#==0., GrayLevel[.8], cf[#]]&] Mar 2 '20 at 6:41
• add the options PlotRange -> {0, All} and ClippingStyle -> Gray?
– kglr
Mar 2 '20 at 6:48
• @kglr that's just what I was looking for, thank you! Mar 2 '20 at 11:14
• j.foobles, you are welcome. I posted the comment as an answer.
– kglr
Mar 2 '20 at 11:24

data = Table[Sin[j^2 + i], {i, 0, Pi, 0.1}, {j, 0, Pi, 0.1}];

You can use the options PlotRange -> {0, All} and ClippingStyle -> Gray:
ListPlot3D[data,