.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\00-band_structure\plot_spin_polarized.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_examples_00-band_structure_plot_spin_polarized.py: .. _ref_plotting_spin_polarized: Plotting spin polarized band structures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Plotting spin polarized band structures. First download the example files with the code below. Then replace data_dir below. .. code-block:: :caption: Downloading example data_dir = pyprocar.download_example(save_dir='', material='Fe', code='vasp', spin_calc_type='spin-polarized-colinear', calc_type='bands') .. GENERATED FROM PYTHON SOURCE LINES 23-24 importing pyprocar and specifying local data_dir .. GENERATED FROM PYTHON SOURCE LINES 24-31 .. code-block:: Python import os import pyprocar data_dir = f"{pyprocar.utils.ROOT}{os.sep}data{os.sep}examples{os.sep}Fe{os.sep}vasp{os.sep}spin-polarized-colinear{os.sep}bands" spins=[0,1] .. GENERATED FROM PYTHON SOURCE LINES 34-39 Plain mode +++++++++++++++++++++++++++++++++++++++ When the calculation is a spin-polarized calculation. There are few more features features bandsplot can do. The default settings bandsplot will plot the spin-up and spin-down bands on the same plot. .. GENERATED FROM PYTHON SOURCE LINES 39-45 .. code-block:: Python pyprocar.bandsplot( code='vasp', mode='plain', fermi=5.590136, dirname=data_dir) .. image-sg:: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_001.png :alt: plot spin polarized :srcset: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none ---------------------------------------------------------------------------------------------------------- There are additional plot options that are defined in the configuration file. You can change these configurations by passing the keyword argument to the function. To print a list of all plot options set `print_plot_opts=True` Here is a list modes : plain , parametric , scatter , atomic , overlay , overlay_species , overlay_orbitals ---------------------------------------------------------------------------------------------------------- (
, ) .. GENERATED FROM PYTHON SOURCE LINES 46-49 The line-styles or line-colors, these may be changed in the ebs section in the :doc:'pyprocar/utils/default_settings.ini' file. The keyword spins can also be used to select which spin bands to plot .. GENERATED FROM PYTHON SOURCE LINES 49-57 .. code-block:: Python spins = [1] pyprocar.bandsplot( code='vasp', mode='plain', fermi=5.590136, spins=spins, dirname=data_dir) .. image-sg:: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_002.png :alt: plot spin polarized :srcset: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none ---------------------------------------------------------------------------------------------------------- There are additional plot options that are defined in the configuration file. You can change these configurations by passing the keyword argument to the function. To print a list of all plot options set `print_plot_opts=True` Here is a list modes : plain , parametric , scatter , atomic , overlay , overlay_species , overlay_orbitals ---------------------------------------------------------------------------------------------------------- (
, ) .. GENERATED FROM PYTHON SOURCE LINES 58-63 Parametric mode +++++++++++++++++++++++++++++++++++++++ For details on the meaning of the indices of the atomic projection please refer to the user guide :ref:'atomic_projections' .. GENERATED FROM PYTHON SOURCE LINES 63-77 .. code-block:: Python atoms=[0] orbitals=[4,5,6,7,8] spins=[0,1] pyprocar.bandsplot( code='vasp', mode='parametric', fermi=5.590136, atoms=atoms, orbitals=orbitals, spins=spins, dirname=data_dir) .. image-sg:: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_003.png :alt: plot spin polarized :srcset: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none ---------------------------------------------------------------------------------------------------------- There are additional plot options that are defined in the configuration file. You can change these configurations by passing the keyword argument to the function. To print a list of all plot options set `print_plot_opts=True` Here is a list modes : plain , parametric , scatter , atomic , overlay , overlay_species , overlay_orbitals ---------------------------------------------------------------------------------------------------------- (
, ) .. GENERATED FROM PYTHON SOURCE LINES 78-83 Scatter mode +++++++++++++++++++++++++++++++++++++++ .. GENERATED FROM PYTHON SOURCE LINES 83-96 .. code-block:: Python atoms=[0] orbitals=[4,5,6,7,8] spins=[0,1] pyprocar.bandsplot( code='vasp', mode='scatter', fermi=5.590136, atoms=atoms, orbitals=orbitals, spins=spins, dirname=data_dir) .. image-sg:: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_004.png :alt: plot spin polarized :srcset: /examples/00-band_structure/images/sphx_glr_plot_spin_polarized_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none ---------------------------------------------------------------------------------------------------------- There are additional plot options that are defined in the configuration file. You can change these configurations by passing the keyword argument to the function. To print a list of all plot options set `print_plot_opts=True` Here is a list modes : plain , parametric , scatter , atomic , overlay , overlay_species , overlay_orbitals ---------------------------------------------------------------------------------------------------------- (
, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.336 seconds) .. _sphx_glr_download_examples_00-band_structure_plot_spin_polarized.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_spin_polarized.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_spin_polarized.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_