.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\01-dos\plot_dosplot_configurations.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_01-dos_plot_dosplot_configurations.py: .. _ref_plot_dos_configuration: Plotting with Configurations in `pyprocar` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This example illustrates how to utilize various configurations for plotting the density of states (DOS) using the `pyprocar` package. It provides a structured way to explore and demonstrate different configurations for the `dosplot` function. Preparation ----------- Before 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. .. code-block:: :caption: Downloading example import pyprocar data_dir = pyprocar.download_example( save_dir='', material='Fe', code='vasp', spin_calc_type='spin-polarized-colinear', calc_type='dos' ) .. GENERATED FROM PYTHON SOURCE LINES 26-36 .. code-block:: Python import os import pyprocar # Define the directory containing the example data code='vasp' data_dir = f"{pyprocar.utils.ROOT}{os.sep}data{os.sep}examples{os.sep}Fe{os.sep}{code}{os.sep}spin-polarized-colinear{os.sep}dos" spins=[0,1] .. GENERATED FROM PYTHON SOURCE LINES 37-52 .. code-block:: Python # Section 1: Locating and Printing Configuration Files # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # This section demonstrates where the configuration files are located in the package. # It also shows how to print the configurations by setting print_plot_opts=True. # # Path to the configuration files in the package config_path = os.path.join(pyprocar.__path__[0], 'cfg') print(f"Configuration files are located at: {config_path}") # Print the configurations pyprocar.dosplot(code=code, dirname=data_dir,fermi=5.599480, print_plot_opts=True) .. image-sg:: /examples/01-dos/images/sphx_glr_plot_dosplot_configurations_001.png :alt: plot dosplot configurations :srcset: /examples/01-dos/images/sphx_glr_plot_dosplot_configurations_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Configuration files are located at: z:\research projects\pyprocar\pyprocar\cfg -------------------------------------------------------- There are additional plot options that are defined in a configuration file. You can change these configurations by passing the keyword argument to the function To print a list of plot options set print_plot_opts=True Here is a list modes : plain , parametric , parametric_line , stack , stack_orbitals , stack_species -------------------------------------------------------- plot_type : PlotType.DENSITY_OF_STATES custom_settings : {} modes : ['plain', 'parametric', 'parameteric_line', 'stack', 'stack_orbitals', 'stack_species', 'overlay', 'overlay_orbitals', 'overlay_species'] cmap : jet colors : ['red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'orange', 'purple', 'brown', 'navy', 'maroon', 'olive'] colorbar_title : Atomic Orbital Projections colorbar_title_size : 15 colorbar_title_padding : 20 colorbar_tick_labelsize : 10 fermi_color : black fermi_linestyle : dotted fermi_linewidth : 1 figure_size : (9, 6) font : Arial font_size : 16 grid : False grid_axis : both grid_color : grey grid_linestyle : solid grid_linewidth : 1 grid_which : major legend : True linestyle : ['solid', 'dashed'] linewidth : [1, 1] marker : ['o', 'v', '^', 'D'] markersize : [0.2, 0.2] opacity : [1.0, 1.0] plot_bar : True plot_color_bar : True plot_total : True savefig : None spin_colors : ['black', 'red'] spin_labels : ['$\\uparrow$', '$\\downarrow$'] title : None verbose : True weighted_color : True weighted_width : False clim : None stack_y_label : DOS x_label : y_label : dpi : figure (
, ) .. GENERATED FROM PYTHON SOURCE LINES 53-75 .. code-block:: Python # Section 2: Changing cmap, clim, and Fermi line properties # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # This section demonstrates how to change the colormap (cmap), color limits (clim), # and Fermi line properties (color, linestyle, and linewidth). # pyprocar.dosplot( code=code, dirname=data_dir, fermi=5.599480, atoms=[0], orbitals=[4,5,6,7,8], mode='parametric', cmap='viridis', # Colormap clim=[0, 1], # Color limits fermi_color='red', # Fermi line color fermi_linestyle='--', # Fermi line linestyle fermi_linewidth=2.0 # Fermi line linewidth ) .. image-sg:: /examples/01-dos/images/sphx_glr_plot_dosplot_configurations_002.png :alt: plot dosplot configurations :srcset: /examples/01-dos/images/sphx_glr_plot_dosplot_configurations_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 a configuration file. You can change these configurations by passing the keyword argument to the function To print a list of plot options set print_plot_opts=True Here is a list modes : plain , parametric , parametric_line , stack , stack_orbitals , stack_species -------------------------------------------------------- (
, ) .. GENERATED FROM PYTHON SOURCE LINES 76-95 .. code-block:: Python # Section 4: Setting the Figure Size and DPI # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # This section demonstrates how to set the figure size and dots per inch (DPI) for the plot. # pyprocar.dosplot( code=code, dirname=data_dir, fermi=5.599480, atoms=[0], orbitals=[4,5,6,7,8], mode='parametric_line', clim=[0,1], figure_size=(10, 6), # Figure size (width, height) dpi=300, # Dots per inch grid=True, # Boolean for grid ) .. image-sg:: /examples/01-dos/images/sphx_glr_plot_dosplot_configurations_003.png :alt: plot dosplot configurations :srcset: /examples/01-dos/images/sphx_glr_plot_dosplot_configurations_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 a configuration file. You can change these configurations by passing the keyword argument to the function To print a list of plot options set print_plot_opts=True Here is a list modes : plain , parametric , parametric_line , stack , stack_orbitals , stack_species -------------------------------------------------------- (
, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.613 seconds) .. _sphx_glr_download_examples_01-dos_plot_dosplot_configurations.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_dosplot_configurations.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_dosplot_configurations.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_