05 August 2021 3 10K Report

To preface this, I have looked on stack overflow but this topic hasn't been addressed as far as I could find.

I am trying to use the Pymatgen vasp modules to plot the element_spd projected dos of Ga2O3, but I can't figure out how to plot the Spd-projected dos for both elements with labels for each element and orbital. Here is my code:

#!/usr/bin/env python3

from pymatgen.io.vasp import Vasprun

from pymatgen.electronic_structure.plotter import DosPlotter

# import data and parse complete density of states from vasprun.xml

data = Vasprun('vasprun.xml')

cdos = data.complete_dos

# parse element-spd dos for each element

ga_spd_dos = cdos.get_element_spd_dos('Ga')

o_spd_dos = cdos.get_element_spd_dos('O')

# create plot, add dos and show plot

plotter = DosPlotter()

plotter.add_dos_dict(ga_spd_dos)

plotter.add_dos_dict(o_spd_dos)

plotter.show()

I get a plot, but the legend only shows spd (those letters, not the proper parsed dos), when what I want is the Ga-s Ga-p Ga-d O-s O-p states all parsed and plotted. I have made sure to include LORBIT = 11 so these orbitals are projected in the vasprun.xml file (I can plot this in a home-brewed script, but I'd like to use pymatgen to create a bit more general script for plotting both the total and element_spd projected density of states without needing separate scripts to parse the dos and then plot the data). Any suggestions or help are greatly appreciated. Thanks!!

More Eric Welch's questions See All
Similar questions and discussions