Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Plotting a function, I noticed some strange spots away from the main feature, the dark purple here:


You can see that they don't actually have any curvature themselves:


Strangely, you don't see them if you look from the bottom:


What are they from? Something about lack of precision or overflow or divergence?

share|improve this question

closed as off-topic by Sjoerd C. de Vries, ciao, m_goldberg, Artes, bobthechemist Apr 17 '14 at 13:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Sjoerd C. de Vries, ciao, m_goldberg, Artes, bobthechemist
If this question can be reworded to fit the rules in the help center, please edit the question.

Could you share a code? :) – Kuba Apr 16 '14 at 20:22
Are you plotting the result of an NDSolve operation? If that is the case, you are trying to perhaps probe a time step of your equation beyond the limits imposed by numerical stability/stiffness for the solver type being used. Conjecture, at best. – drN Apr 16 '14 at 22:19
@Kuba I will tomorrow when I'm at work, but... it's very involved. It's created by a function that calls about 20 other functions in making it. – YungHummmma Apr 17 '14 at 5:52
@drN No, but it is an NIntegrate[] that creates it. I suspect that might be similar? – YungHummmma Apr 17 '14 at 5:53
@YungHummmma Yes, I would suspect so. – drN Apr 17 '14 at 13:27

It looks to me like you've got some inconsistency in your VertexNormals. This can certainly happen with numerically generated functions though, as others have rightly pointed out, it's hard to say for sure without some more specific info. Here's a simple way to force this sort of thing to happen.

(* A list of vertices to feed to Polygon *)
pts = Flatten[Table[
    {{x, y, 0}, {x + 1, y, 0}, {x + 1, y + 1, 0}, {x, y + 1, 0}},
    {x, -3, 3}, {y, -3, 3}],

(* Orient the vertex normals upward *)
normals = Table[{0, 0, 1}, 
   Evaluate[Sequence @@ Most[List /@ Dimensions[pts]]]];

(* Flip a few of them *)
normals[[25, 1, 3]] = -1;
normals[[25, 2, 3]] = -1;
normals[[25, 3, 3]] = -1;
normals[[26, 2, 3]] = -1;
normals[[26, 3, 3]] = -1;

(* Visualize *)
Graphics3D[Polygon[pts, VertexNormals -> normals],
 PlotRange -> {-2, 2}]

enter image description here

share|improve this answer

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