.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "user-guide/usage/visualization/plot_5_atoms.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_user-guide_usage_visualization_plot_5_atoms.py: ************** Plotting atoms ************** This page explains how to plot a set of atoms. .. GENERATED FROM PYTHON SOURCE LINES 29-62 .. code-block:: Python import wulfric import numpy as np cell = np.array( [ [0.000000, 4.744935, 0.000000], [3.553350, 0.000000, 0.000000], [0.000000, 0.000000, 8.760497], ] ) atoms = { "names": ["Cr1", "Br1", "S1", "Cr2", "Br2", "S2"], "positions": np.array( [ [0.000000, -0.500000, 0.882382], [0.000000, 0.000000, 0.677322], [-0.500000, -0.500000, 0.935321], [0.500000, 0.000000, 0.117618], [0.500000, 0.500000, 0.322678], [0.000000, 0.000000, 0.064679], ] ), } pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_atoms(cell=cell, atoms=atoms) pe.plot_cell(cell=cell) pe.show() .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 63-67 Atoms'labels are deduced based on ``atoms["names"]``. Atom's colors are deduced based on atom's species, but can be directly passed to the function as well. .. GENERATED FROM PYTHON SOURCE LINES 67-78 .. code-block:: Python atoms = dict(positions=atoms["positions"]) pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_atoms(cell=cell, atoms=atoms) pe.plot_cell(cell=cell) pe.show() .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/wulfric/envs/latest/lib/python3.11/site-packages/wulfric/crystal/_atoms.py:112: RuntimeWarning: Atom species deduction failed for 'X1'. Set species to 'X' warnings.warn( /home/docs/checkouts/readthedocs.org/user_builds/wulfric/envs/latest/lib/python3.11/site-packages/wulfric/crystal/_atoms.py:112: RuntimeWarning: Atom species deduction failed for 'X2'. Set species to 'X' warnings.warn( /home/docs/checkouts/readthedocs.org/user_builds/wulfric/envs/latest/lib/python3.11/site-packages/wulfric/crystal/_atoms.py:112: RuntimeWarning: Atom species deduction failed for 'X3'. Set species to 'X' warnings.warn( /home/docs/checkouts/readthedocs.org/user_builds/wulfric/envs/latest/lib/python3.11/site-packages/wulfric/crystal/_atoms.py:112: RuntimeWarning: Atom species deduction failed for 'X4'. Set species to 'X' warnings.warn( /home/docs/checkouts/readthedocs.org/user_builds/wulfric/envs/latest/lib/python3.11/site-packages/wulfric/crystal/_atoms.py:112: RuntimeWarning: Atom species deduction failed for 'X5'. Set species to 'X' warnings.warn( /home/docs/checkouts/readthedocs.org/user_builds/wulfric/envs/latest/lib/python3.11/site-packages/wulfric/crystal/_atoms.py:112: RuntimeWarning: Atom species deduction failed for 'X6'. Set species to 'X' warnings.warn( .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.083 seconds) .. _sphx_glr_download_user-guide_usage_visualization_plot_5_atoms.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_5_atoms.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_5_atoms.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_5_atoms.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_