abinit/abitutorials

Would like to plot L-projected dos of the fatbands one below the other in Vertical manner ?

Closed this issue · 2 comments

In the MgB2 fatband tutorial, I would like to know the location of the plotting code that plots the L-projected dos horizontally.

I would like to plot it vertically for easily comparing the energy levels of each atoms dos.

The relevant code is here

You can use exchange_xy=True to plot the energy along the x-axis.

The function returns a matplotlib figure thus one can access the Axes of the figure
and plot additional quantities once the initial figure has been produced:

In pseudo code:

import matplotlib.pyplot as plt
fig = ncfile.plot_pjdos_lview(exchange_xy=True, show=False)
for ax in fig.axes:
  ax.plot(xs, ys)
plt.show()

Alternatively, one can build a matrix of matplotlib Axes in the script and pass it
to plot_pjdos_lview. See ax_mat argument.

Thanks a lot for the support !