I have a data set with four columns, i.e. dimensions, all are numerical. The last attribute is either 0 or 1. So I want to plot the data in the following way: the first three entries are the coordinates and the determines the color (0:Red, 1: Green). I can plot this using Graphics3D
like:
Example data:
list = {{1, 29., 2, 1}, {1, 0.9167, 1, 1}, {1, 2., 2, 0}, {1, 30., 1,0}, {1, 25., 2, 0}}
then:
ClearAll[plotPoint];
plotPoint[list_List] := Module[{c, a, g, s},
{c, a, g, s} = list;
If[s == 1,
Graphics3D[{PointSize[Small], Green, Point[{c, a, g}]}],
Graphics3D[{PointSize[Small], Red, Point[{c, a, g}]}]
]
]
then
Show[plotPoint /@ list]
delivers an output. What I now tried to achieve is to do this job with ListPointPlot3D
to get axes and so on. But here I can only deliver a ColorFunction
which takes three arguments (the coordinates) and I could not manage to get my fourth attribute (last components in data set) in there to get the coloring.
Is there any way to do this?