Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm able to plot a 3D plot of a grayscale image using ListPlot3D, where it plots a 3D surface of the image pixel intensity. But I would like not to plot the pixel value below a certain value. In the specific case I'm working on, I want to remove all the pixels with value zero but still plot the pixels that are above zero at there original position. Does anyone knows of how to do this?

share|improve this question
1  
Please provide any code you've already written and we can show you how to fix it. –  Pickett Oct 25 '13 at 11:22
add comment

1 Answer

up vote 1 down vote accepted
threshold = 0;
f[x_, y_] := Clip[Sin[1/5 x y], {0, 1}]
t = Table[f[x, y], {x, -2 Pi, 2 Pi, .1}, {y, -2 Pi, 2 Pi, .1}];
GraphicsRow@{it = Image@t, ListPlot3D[ImageData@it, PlotRange -> {threshold + 10^-10, 1}, 
                           ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 5, 
                           ColorFunction -> "SunsetColors"]}

Mathematica graphics

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.