I am trying to label some points in 3D plotting. First, I'd like to label all points. The code below does not work, there seem to be a problem with a "Graphics" command, any ideas?
Next, what would be the best way for labeling only certain points, not all of them?
Thanks for your help!!!!
TCzvdata = {{258, 1028, 0}, {217, 747, 0}, {212, 754, 0}, {210, 748,
0}, {191, 654, 0}, {157, 638, 0}};
dataPlot = ListPointPlot3D[TCzvdata, PlotStyle -> PointSize -> Large];
labels = Text[#[[1]], 1.1 #[[{2, 3}]]] & /@ TCzvdata
Show[dataPlot, AspectRatio -> 1, Graphics[{Red, labels}]]
Answer
An alternative
data =
{{258, 1028, 0}, {217, 747, 0}, {212, 754, 0}, {210, 748, 0}, {191, 654, 0}, {157, 638, 0}};
Show[
Graphics3D[{Blue, PointSize[0.04], Point[data]}],
Graphics3D[Text[#[[1]], 1.04 #] & /@ data],
Axes -> True,
BoxRatios -> 1]
Just for fun with points more apart
data =
{{258, 830, 0}, {217, 747, 0}, {212, 680, 0}, {210, 520, 0}, {191, 654, 0}, {157, 638, 0}};
Show[
Graphics3D[Table[{RandomColor[], Sphere[n, 20]}, {n, data}]],
Graphics3D /@ Map[Text[Framed[#[[1]], Background -> White], #] &, data],
Axes -> True, ImageSize -> 500]
Comments
Post a Comment