title: pymatgen plotting DOS
body: <p>I am trying to plot DOS (density of states) with pymatgen but I can't make it work. First time encountering <code>self</code> and <code>class</code> functions in python so I am at a loss. </p>
  
  <p>This <a href="http://pymatgen.org/pymatgen.electronic_structure.dos.html" rel="nofollow noreferrer">link</a> explains the package that has the function I need (I need to use <code>get_site_t2g_eg_resolved_dos(site)</code> part of the class <code>CompleteDos</code> ). This <a href="http://pymatgen.org/_modules/pymatgen/electronic_structure/dos.html" rel="nofollow noreferrer">link</a> has the source code for those functions. Looking at the <a href="http://pymatgen.org/_static/Analyze%20and%20plot%20band%20structures.html" rel="nofollow noreferrer">examples</a> found online  I have made this code</p>
  
  <pre><code>from pymatgen.electronic_structure.dos import CompleteDos
  from pymatgen.electronic_structure.plotter import DosPlotter
  from pymatgen.electronic_structure.core import Spin, Orbital
  
  data = CompleteDos.get_site_t2g_eg_resolved_dos
  plot = DosPlotter(data)
  plot.get_plot(-5,5).show()
  </code></pre>
  
  <p>That code returns an error and I am sure it's because the function <code>get_site_t2g_eg_resolved_dos</code> is not used correctly. </p>
  
  <p>Even if you don't know pymatgen with the links provided I think you could help me in the proper way of using the functions, I'd highly appreciate it. Thanks in advance!</p>
  
  <hr>
  
  <p>Edit: How the code I am trying looks like now, leave both because I am not sure if I am doing things correctly.</p>
  
  <pre><code>from pymatgen.electronic_structure.dos import CompleteDos
  from pymatgen.electronic_structure.plotter import DosPlotter
  from pymatgen.electronic_structure.core import Spin, Orbital
  from pymatgen.io.vasp.outputs import Vasprun, Procar
  from pymatgen.core.ion import Ion
  
  vasprun = Vasprun("./vasprun.xml")
  
  pdos = vasprun.pdos
  tdos = vasprun.tdos
  efermi = vasprun.efermi
  energy = vasprun.eigenvalues
  structure = vasprun.structures
  
  
  
  a = CompleteDos(structure, tdos, pdos)
  data = a.get_site_t2g_eg_resolved_dos(structure)
  plot = DosPlotter(data)
  plot.get_plot().show()
  </code></pre>
  
  <p>Error in output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "t2g2g.py", line 21, in &lt;module&gt;
      data= a.get_site_t2g_eg_resolved_dos(structure)
    File "/usr/local/lib/python2.7/dist-packages/pymatgen/electronic_structure/dos.py", line 351, in get_site_t2g_eg_resolved_dos
      for s, atom_dos in self.pdos.items():
  AttributeError: 'list' object has no attribute 'items'
  </code></pre>