# Inaccuracy in Plot3D

This problem might be well-known - in this case, I would appreciate a link, because I could not find anything. My problem: A certain function (super long and nasty expression) needs to be plotted. However, it seems that there is some weird coloring problem. The code goes like (f is really very long and it does not happen with shorter expressions. I dont think it is reasonable to show the form of f)

Plot3D[f,{x,-10,10},{y,-10,10},
PlotRange->All,
Ticks->{{-9,-6,-3,0,3,6,9},{-9,-6,-3,0,3,6,9},{1,3,5}}
AxesStyle->Directive[Thick],
Boxed->False,
TickStyle->Directive[Thick,Black,14],
LabelStyle->Directive[Black,20],
PlotStyle->Directive[Yellow,Specularity[White,20],Opacity[0.9],
ColorFunction->"Rainbow",
PlotPoints->80,
Viewpoint->{-1,1.5,1.5}
]


PlotPoint does not seem to be the problem, since doubling them does not help.

See the plot to understand the problem. This black fuzzy stuff should not be there. I dont know how to better describe it. Any experiences with this? Thanks!

• Without the definition of f, it's hard to diagnose or cure the problem you see! But does specifying a non-default value for option MaxRecursion help at all? – murray Dec 12 '18 at 20:54
• I believe these are shadows from the Lighting. Try adding the option Lighting -> {{"Ambient", White}}. – Edmund Dec 12 '18 at 22:57
• Yep, I've seen it before. Cannot make sure what will fix it without f. – Michael E2 Dec 13 '18 at 0:36

Without the function my best guesstimate is that you are seeing shadows from the Lighting option.

SeedRandom[4328]
ListPlot3D[RandomReal[1, {9, 9}],
InterpolationOrder -> 2,
ColorFunction -> "Rainbow",
Mesh -> None]


Notice above that there are some dark areas of shadow. There are many settings for Lighting but a basic setting to rid your plot of shadows is Lighting -> {{"Ambient", White}}.

SeedRandom[4328]
ListPlot3D[RandomReal[1, {9, 9}],
InterpolationOrder -> 2,
ColorFunction -> "Rainbow",
Mesh -> None,
Lighting -> {{"Ambient", White}}]


Now notice that the shadows are gone.

Hope this helps.