I would like to label the atoms of a molecule imported from an XYZ file. The only example that I found is the following (How to label with numbers atoms when MoleculePlot3D):
mol = Molecule["Formaldehyde"];
Show[ MoleculePlot3D[mol],
Graphics3D[MapThread[Text,
{Style[#, 16] & /@ Range[4], mol["AtomCoordinates"]["Magnitudes"]}]]]
Could you please help me how to modify this code to take the molecule from an XYZ file, say from "ExampleData/caffeine.xyz"
? And is there any way to label the atoms individually?
Molecule["Formaldehyde"]
withImport["ExampleData/caffeine.xyz"]
, andRange[4]
withRange[AtomCount[mol]]
$\endgroup$