There's a small trick to it, but it's fortunately pretty straightforward
Assuming we have two (at least) band structures in the same NetCDF file ("file.nc"), I hope this script is self-explanatory:
from NanoLanguage import *
import pylab as P
# Colors for each band structure (add more if you have more than 4 band structures in the file)
colors = ['r','b','g','m']
bandstructures = nlread("file.nc", Bandstructure)
for i,bs in enumerate(bandstructures):
P.plot(bs._axisGUI(), bs.evaluate(), colors[i])
P.savefig("plot.png")
Here's a more advanced version, which allows you to set the limits of the energy axis (often needed) and include the route labels.
from NanoLanguage import *
import pylab as P
# Parameters
ncfile = 'file.nc'
plotfile = 'plot.png'
ymin = -10
ymax = 10
# Colors for each band structure (add more if you have more than 4 band structures in the file)
colors = ['r','b','g','m']
bandstructures = nlread(ncfile, Bandstructure)
for i,bs in enumerate(bandstructures):
P.plot(bs._axisGUI(), bs.evaluate(), colors[i])
# Set x-ticks = the symmetry points
kticks = [ tick[0] for tick in bs._ticksGUI() ]
ticklabels = [ tick[1].replace('Γ','$\Gamma$') for tick in bs._ticksGUI() ]
P.xticks(kticks,ticklabels)
P.grid(kticks)
P.ylim(ymin,ymax)
P.savefig(plotfile)