# How to use the SymbolName of variables along with Map and pure function

I want to label each point of a Graphics3D with the simplest method as possible.

I tried many solutions like this :

 Manipulate[
α ∈ Reals; A1 = {-1, 0, 1}; A2 = {Cos[α], Sin[2 α], -2};
With[{polyw = PolyhedronData[poly, "Polyhedron"]},
Graphics3D[{PointSize[0.03],
Map[{Text[Style[SymbolName[Unevaluated[#]]], RGBColor[Abs[#] // Round], 1.1 #],
Style[Point[#], RGBColor[Abs[Round[#]]]]} &, {A1, A2, B1, B2}],
MapIndexed[Text[#2[[1]], #] &, PolyhedronCoordinates[polyw]],
polyw}]],
{α, 0, Pi}, {poly, "Cube"}
]


But the variable # is evalute before the function Unevaluate

So I would like to know if there are a simple method to print the name of the variable (I have many, many points to enable in the graphic).

Maybe by using Information[] ?

• As an aside, your first line inside the Manipulate Element[alpha, Reals] does nothing for you. You should include it in the global \$Assumptions or wrap thinks in Assuming, or use the Assumptions -> option for functions that have it. – MarcoB May 24 at 15:18
• B1, B2 are not defined in your code. You also have an odd Style[SymbolName[Unevaluated[#]]] within your Text: that's a call to Style without any styling directives, so it won't do much for you. More in general, can you simplify your code to a MUCH simpler minimal working example that gives rise to the same problem? For instance, what features do you want to label, and which labels do you want to use for each feature? – MarcoB May 24 at 15:48

Enter values as strings and convert to expressions.

EDIT: Added Opacity control

Manipulate[
A1 = {-1, 0, 1};
A2 = {Cos[α], Sin[2 α], -2};
With[
{polyw = PolyhedronData[poly, "Polyhedron"]},
Graphics3D[{
PointSize[0.03],
Map[{
RGBColor @@ Abs[#[[2]] // Round],
Text[#[[1]], #[[2]], {1.5, 1.5}],
Point[#[[2]]]} &,
MapIndexed[
Text[#2[[1]], #] &,
PolyhedronCoordinates[polyw]],
{Opacity[opac], polyw}}]],
{{α, 1.}, 0, Pi, 0.01, Appearance -> "Labeled"},
{{opac, 0.5, "Opacity"}, 0, 1, 0.05,
Appearance -> "Labeled"},
{{poly, "Cube", Polyhedron},
PolyhedronData["Platonic"],