Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

White area in Mathematica ListPlot

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?

like image 865
Samizdis Avatar asked Aug 12 '11 15:08

Samizdis


1 Answers

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

like image 56
Brett Champion Avatar answered Oct 18 '22 00:10

Brett Champion