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?
$\begingroup$
$\endgroup$
1
-
1$\begingroup$ Please provide any code you've already written and we can show you how to fix it. $\endgroup$– C. E.Oct 25, 2013 at 11:22
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
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"]}