I know it is possible to view .xyz files of coordinates in Mathematica. I tried to write some text on a specific atom using Text, but I was not successful. How can i do that? Thanks for the help in advance.


1 Answer 1


Text should work. For example

{g, n, p} = Import["ExampleData/caffeine.xyz", 
    {{"Graphics3D", "VertexTypes", "VertexCoordinates"}}];

Show[g, Graphics3D[MapThread[Text, {n, p}]]]

enter image description here

  • 1
    $\begingroup$ OP can also style the text: MapThread[Style[Text[##], 12, Bold, White] &, {n, p}] $\endgroup$
    – Bob Hanlon
    Dec 19, 2015 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.