# Are there commands other than ListPlot3D for plotting 3D points, where one coordinate ls either 0 or 1, and the other two lie in [0,1]?

I have a set of 3D points, the first coordinate of which, say, is confined to the values 0 and 1, while the other two can assume values within the unit interval [0,1]. ListPlot3D shows a continuous variation of the first value--which perhaps is somewhat misleading.

Can I represent the discreteness of the first coordinate, while simultaneously showing the continuous nature of the other two?

What's appropriate if the set is only 2D, the first coordinate of which, again is confined to the values 0 and 1, while the other ONE can assume values within the unit interval [0,1]?

• something like SeedRandom[1]; n = 40; xyz = Transpose[{RandomChoice[{0, 1}, n], RandomReal[1, n], RandomReal[1, n]}]; ListPointPlot3D[SortBy[First] /@ GatherBy[xyz, First]] /. p_Point :> {p, Line @@ p}?
– kglr
Commented May 24, 2021 at 1:13

Your data lay in 2 planes: {0,x,y} and {1,x,y}, so they are essentially 2 dimensional. Therefore we may display this in 2D as 2 separate plots or in one plot where the sign of the coordinates of one plane is inverted. E.g:

n = 20;
d1 = RandomReal[{0, 1}, {n, 2}];
d2 = -1 RandomReal[{0, 1}, {n, 2}];
ListPlot[Join[d1, d2]]


Of course you may also plot them in 3D:

n = 20;
d1 = Table[{0, RandomReal[{0, 1}], RandomReal[{0, 1}]}, n];
d2 = Table[{1, RandomReal[{0, 1}], RandomReal[{0, 1}]}, n];
ListPointPlot3D[Join[d1, d2]]