5

When I create and plot this list:

var = 2;
okList = {{0.8, var, 0.8, 0.8}, {0, 0.3, 0.6, 0.9}, {0, 1, 2, 3}};
lp = ListDensityPlot[okList, ColorFunction -> "SandyTerrain"]

scaled

or, unscaled, like this:

lp = ListDensityPlot[okList, ColorFunction -> "SandyTerrain",
     ColorFunctionScaling -> False]

unscaled

I get a fully coloured square, as I'd expect.

But when I try this:

var = 0.8;
list = {{0.8, var, 0.8, 0.8}, {0, 0.3, 0.6, 0.9}, {0, 1, 2, 3}};
problem = ListDensityPlot[list, ColorFunction -> "SandyTerrain"]

I get a white patch in the corner.

problem

which plotting with ColorFunctionScaling->False doesn't get rid of

problem_scaled

The ColorFunction SandyTerrain doesn't have any white in it, so this must be ListDensityPlot not plotting anything in that area.

What could cause this to happen, and how do I stop it?

Samizdis
  • 1,591
  • 1
  • 17
  • 33

1 Answers1

6

It's getting clipped by the automatic plot range calculation. Try with PlotRange -> All or ClippingStyle -> Automatic.

Brett Champion
  • 8,497
  • 1
  • 27
  • 44
  • Both work, but the resultant graphs are slightly different. Do you know why? – Samizdis Aug 12 '11 at 15:53
  • 2
    On my system (V8.0.1 on OS X), `ClippingStyle -> Automatic` doesn't noticeably change the colors. `PlotRange -> All` does, because the increased range affects the range that is scaled to [0,1] by `ColorFunctionScaling -> True`. – Brett Champion Aug 12 '11 at 21:49