{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Comparing band structures\n\nComparing band structures example.\n\nFirst download the example files with the code below. Then replace data_dir below.\n\n.. code-block::\n   :caption: Downloading example\n\n    vasp_data_dir = pyprocar.download_example(save_dir='', \n                                material='Fe',\n                                code='vasp', \n                                spin_calc_type='non-spin-polarized',\n                                calc_type='bands')\n\n    qe_data_dir = pyprocar.download_example(save_dir='', \n                                material='Fe',\n                                code='qe', \n                                spin_calc_type='non-spin-polarized',\n                                calc_type='bands')\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "importing pyprocar and specifying local data_dir\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import os\n\nimport pyprocar\n\nvasp_data_dir = os.path.join(\n    pyprocar.utils.DATA_DIR, \"examples\", \"Fe\", \"vasp\", \"non-spin-polarized\", \"bands\"\n)\nqe_data_dir = os.path.join(\n    pyprocar.utils.DATA_DIR, \"examples\", \"Fe\", \"qe\", \"non-spin-polarized\", \"bands\"\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "When show is equal to False, bandsplot will return a maplotlib.Figure and maplotlib.axes.Axes object\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig, ax = pyprocar.bandsplot(\n    code=\"vasp\",\n    dirname=vasp_data_dir,\n    mode=\"parametric\",\n    fermi=5.599480,\n    elimit=[-5, 5],\n    orbitals=[4, 5, 6, 7, 8],\n    show=False,\n)\npyprocar.bandsplot(\n    code=\"qe\",\n    dirname=qe_data_dir,\n    mode=\"plain\",\n    fermi=18.2398,\n    elimit=[-5, 5],\n    color=\"k\",\n    ax=ax,\n    show=True,\n)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.9.20"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}