3
$\begingroup$

I was trying to draw a simple surface and ended up with some modern art... if we start with a surface defined by a Gaussian shape and plot it, all looks well:

surf = GaussianMatrix[{100, 10}];
ListPlot3D[surf]

enter image description here

But if I try to plot the closely related 1-surf, some weird things happen:

ListPlot3D[1 - surf]

enter image description here

Rotating the image with my mouse gives:

enter image description here

I guess I'm wondering if there is something strange/iodiosyncratic about my setup or if this is generic...

$\endgroup$
2
  • $\begingroup$ What does surf look like if you give the vertical a range of 0 to 1? Maybe you can gather something from that? $\endgroup$ Commented Jul 1, 2020 at 14:17
  • 3
    $\begingroup$ It's modern art for sure. Setting PlotRange -> Full resolves the issue, so I think the problem lies in the code that selects the plot range automatically. There's something with the value range that it doesn't like. $\endgroup$
    – C. E.
    Commented Jul 1, 2020 at 14:35

1 Answer 1

9
$\begingroup$

You have too many 1.'s, I guess, and the automatic plot range is too small.

ListPlot3D[1 - surf, PlotRange -> 1 - MinMax[surf]]

enter image description here

More than half of the entries of 1 - surf are 1.:

1 - surf;
Count[Flatten@%, 1.]
Length@Flatten@%%
(*
  21060
  40401
*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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