:orphan: .. _user-guide_usage_visualization: ************* Visualization ************* For the full technical reference see :py:class:`wulfric.PlotlyEngine`. Visualization in wulfric is implemented with |plotly|_. Visualization backend ===================== First, one need to create an instance of the plotting engine as .. doctest:: >>> import wulfric >>> pe = wulfric.PlotlyEngine() The creation of the plotting engine can take one optional argument: ``fig``: .. doctest:: >>> from plotly import graph_objects as go >>> fig = go.Figure() >>> pe = wulfric.PlotlyEngine(fig=fig) After plotting the figure can be either displayed .. doctest:: >>> pe.show(width=1000, height=800) # doctest: +SKIP or saved as an .html file .. doctest:: >>> pe.save(output_name="wulfric-plot.html", width=1000, height=800) # doctest: +SKIP :py:class:`wulfric.PlotlyEngine` has a number of methods that can be used to plot cell, atoms, lattice and so on. Check examples to get a feeling on what is implemented .. _user-guide_usage_visualization_examples: Examples ======== .. raw:: html
.. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_1_basic_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_1_basic` .. raw:: html
Basic objects
.. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_2_cell_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_2_cell` .. raw:: html
Plotting a cell
.. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_3_lattice_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_3_lattice` .. raw:: html
Lattice points
.. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_4_wigner-seitz_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_4_wigner-seitz` .. raw:: html
Wigner-Seitz cell
.. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_5_atoms_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_5_atoms` .. raw:: html
Plotting atoms
.. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_6_kpath_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_6_kpath` .. raw:: html
K-path and k-points
.. raw:: html
.. only:: html .. image:: /user-guide/usage/visualization/images/thumb/sphx_glr_plot_7_subplots_thumb.png :alt: :doc:`/user-guide/usage/visualization/plot_7_subplots` .. raw:: html
Subplots
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /user-guide/usage/visualization/plot_1_basic /user-guide/usage/visualization/plot_2_cell /user-guide/usage/visualization/plot_3_lattice /user-guide/usage/visualization/plot_4_wigner-seitz /user-guide/usage/visualization/plot_5_atoms /user-guide/usage/visualization/plot_6_kpath /user-guide/usage/visualization/plot_7_subplots .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-gallery .. container:: sphx-glr-download sphx-glr-download-python :download:`Download all examples in Python source code: visualization_python.zip ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download all examples in Jupyter notebooks: visualization_jupyter.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_