{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Plotting with Configurations in `pyprocar`\n\nThis example illustrates how to utilize various configurations for plotting the 2D Fermi surface with non-colinear spin textures using the `pyprocar` package. It provides a structured way to explore and demonstrate different configurations for the `fermi2D` function. For more information about `fermi2D`, refer to `fermi2d`.\n\n## Preparation\nBefore diving into plotting, we need to download the example files. Use the following code to do this. Once downloaded, specify the `data_dir` to point to the location of the downloaded data.\n\n.. code-block::\n   :caption: Downloading example\n\n    data_dir = pyprocar.download_example(save_dir='', \n                                material='Fe',\n                                code='vasp', \n                                spin_calc_type='non-colinear',\n                                calc_type='fermi')\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import os\n\nimport pyprocar\n\ndata_dir = os.path.join(\n    pyprocar.utils.DATA_DIR, \"examples\", \"Fe\", \"vasp\", \"non-colinear\", \"fermi\"\n)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# Section 1: Locating and Printing Configuration Files\n# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n#\n# This section demonstrates where the configuration files are located in the package.\n# It also shows how to print the configurations by setting print_plot_opts=True.\n#\n\n# Path to the configuration files in the package\nconfig_path = os.path.join(pyprocar.__path__[0], \"cfg\")\nprint(f\"Configuration files are located at: {config_path}\")\n\n# Print the configurations\npyprocar.fermi2D(code=\"vasp\", dirname=data_dir, fermi=5.599480, print_plot_opts=True)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# Section 2: Spin Texture Projection with Custom Settings\n# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n#\n# This section demonstrates how to customize the appearance of the spin texture arrows.\n# We'll adjust the colormap, color limits.\n#\n\npyprocar.fermi2D(\n    code=\"vasp\",\n    fermi=5.599480,\n    dirname=data_dir,\n    spin_texture=True,\n    spin_projection=\"x\",\n    arrow_size=3,\n    arrow_density=10,\n    plot_color_bar=True,\n    cmap=\"jet\",\n    clim=[0, 1],\n)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# Section 3: Adjusting DPI\n# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n#\n# This section demonstrates how to adjust the dots per inch (DPI) for the combined plot.\n#\n\n\npyprocar.fermi2D(\n    code=\"vasp\",\n    dirname=data_dir,\n    fermi=5.599480,\n    spin_texture=True,\n    spin_projection=\"z\",\n    arrow_size=3,\n    arrow_density=10,\n    plot_color_bar=True,\n    cmap=\"jet\",\n    clim=[0, 1],\n    dpi=300,\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
}