3
$\begingroup$

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.

$\endgroup$

1 Answer 1

8
$\begingroup$

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

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

Your Answer

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

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