.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_bz.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_plot_bz.py: Brillouin zone ============== This example shows how to display the Brillouin zone with pymatgen and matplotlib. .. GENERATED FROM PYTHON SOURCE LINES 9-18 .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata # Open the WKF file. wfk_file = abiopen(abidata.ref_file("si_scf_WFK.nc")) # Extract the crystalline structure. structure = wfk_file.structure .. GENERATED FROM PYTHON SOURCE LINES 19-20 To visualize the BZ with matplotlib, use: .. GENERATED FROM PYTHON SOURCE LINES 20-22 .. code-block:: default structure.plot_bz() .. image:: /gallery/images/sphx_glr_plot_bz_001.png :alt: plot bz :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none
.. GENERATED FROM PYTHON SOURCE LINES 23-24 Remember to close the wfk file with: .. GENERATED FROM PYTHON SOURCE LINES 24-25 .. code-block:: default wfk_file.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.226 seconds) .. _sphx_glr_download_gallery_plot_bz.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/plot_bz.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_bz.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_bz.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_