# ListSliceDensityPlot3D gives wrong plot with specified surfaces

First, define

data = Flatten[
Table[{x, y, z, -N@HeavisidePi[1.1 x]}, {x, -1, 1, 0.1}, {y, -1, 1,
1}, {z, -1, 1, 1}], 2]


In which I used -N@HeavisidePi[1.1 x], its plot is

If I plot this

ListSliceDensityPlot3D[data, {"XStackedPlanes", Subdivide[-1, 1, 20]},
PlotLegends -> Automatic]


This will gives

This is right.

However If I plot only two surface at x=-0.5 and x=0.5

ListSliceDensityPlot3D[data, {"XStackedPlanes", {-0.5, 0.5}},
PlotLegends -> Automatic]


This will give wrong plot

Only plot one surface is also not right.

ListSliceDensityPlot3D[data, {"XStackedPlanes", {-1}},
PlotLegends -> Automatic]


What is wrong?

I am using Mathematica 10.4.0.0

• Definitely a bug, you can use Table[] though, that works. – Feyre Aug 7 '16 at 14:57
• @Feyre Hi, Feyre. What do you mean by using Table[]? – matheorem Aug 7 '16 at 15:41
• It seemed my solution just made the two bugs interfere. To be honest, I don't really think ListSliceDensityPlot3D is designed for these circumstances, but I'd report it as a bug. – Feyre Aug 7 '16 at 16:57
• @Feyre Thank you for reporting, Feyre. – matheorem Aug 8 '16 at 2:35

As a workaround to this bug, you can specify a color function directly and turn ColorFunctionScaling off.
With[