.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plotly_phbands_and_dos.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plotly_phbands_and_dos.py: Phonon Band structures (Plotly version) ======================================= This example shows how to plot the phonon band structure of AlAs with plotly. See tutorial/lesson_rf2.html .. GENERATED FROM PYTHON SOURCE LINES 9-20 .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata # Open the PHBST file produced by anaddb and get the phonon bands. with abiopen(abidata.ref_file("trf2_5.out_PHBST.nc")) as ncfile: phbands = ncfile.phbands # Read the Phonon DOS from the netcd file produced by anaddb (prtdos 2) with abiopen(abidata.ref_file("trf2_5.out_PHDOS.nc")) as ncfile: phdos = ncfile.phdos .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Warning: file /Users/gmatteo/git_repos/abipy/abipy/data/refs/alas_phonons/trf2_5.out_PHBST.nc does not contain atomic_numbers. Particular methods need them! .. GENERATED FROM PYTHON SOURCE LINES 21-23 plot phonon bands and DOS. `plot_phonons_lo_to.py` shows how to treat the LO-TO splitting. .. GENERATED FROM PYTHON SOURCE LINES 23-26 .. code-block:: default phbands.plotly(title="AlAs Phonon bands and DOS in eV") .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 27-28 plot phonon bands with DOS. .. GENERATED FROM PYTHON SOURCE LINES 28-31 .. code-block:: default phbands.plotly_with_phdos(phdos, units="cm-1", title="AlAs Phonon bands + DOS in cm-1") .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 32-33 plot phonon DOS. .. GENERATED FROM PYTHON SOURCE LINES 33-41 .. code-block:: default phdos.plotly(units="cm-1", title="Phonon DOS and IDOS in cm-1") # Plot the phonon band structure with different color for each line. #phbands.plot_colored_matched(units="cm-1", # title="AlAs with different color for each line.") # sphinx_gallery_thumbnail_path = '_static/plotly_logo.png' .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.564 seconds) .. _sphx_glr_download_gallery_plotly_phbands_and_dos.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/abinit/abipy/gh-pages?filepath=notebooks/gallery/plotly_phbands_and_dos.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plotly_phbands_and_dos.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plotly_phbands_and_dos.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_