How to draw points in 3D and provide labels for each? [closed]

Is is possible to draw something like this in Mathematica?

• Certainly. Look at Text in the documentation. – m_goldberg Aug 18 '17 at 17:16

co = {{0, 0, 0}, {1, 1, 1}, {2, 2, 2}};

Graphics3D[{Red, PointSize[0.02], Point[co], Black,
Style[MapThread[Text, {{"a", "b", "c"}, co - 0.1}], Bold, 16]}, Axes -> True]


If you want flat 2-d markers rendering 3D data, symbols for markers tends to be pretty handy (and has a long history).

Simple example:

targetPoints[
data_] := {Style[Map[Text["\[CirclePlus]", #] &, data], Blue, 14],
Style[MapIndexed[Text[#2[[1]], #] &, # - {1., 1., -1.} & /@ data],
12]}

cdPoints[data_] := {Style[Map[Text["\[CircleDot]", #] &, data], Red,
14], Style[
MapIndexed[Text[#2[[1]], #] &, # - {1., 1., -1.} & /@ data], 12]}

sqPoints[data_] := {Style[Map[Text["\[Square]", #] &, data],
RGBColor[0.31, 0.5, 0.4], Bold, Large],
Style[MapIndexed[Text[#2[[1]], #] &, # - {1., 1., -1.} & /@ data],
12]}

Graphics3D[{sqPoints[RandomReal[{10, 55}, {8, 3}]],
cdPoints[RandomReal[{10, 55}, {8, 3}]],
targetPoints[RandomReal[{10, 55}, {7, 3}]]} // Flatten,
Axes -> True]


yields:

or if you really don't like the box, and enjoy that sort of flat aspect, can play with Graphics3D options

Graphics3D[{sqPoints[RandomReal[{10, 55}, {8, 3}]],
cdPoints[RandomReal[{10, 55}, {8, 3}]],
targetPoints[RandomReal[{10, 55}, {7, 3}]]} // Flatten,
Axes -> True, Boxed -> False,
PlotRange -> {{10, 60}, {10, 60}, {10, 60}}, AspectRatio -> 1]