spinw
spinw copied to clipboard
plotchem plots bonds outside of unit cell
Hi Sandor It seems that when an atom is right at the edge of the unit cell, plotchem will plot the bonds from that atom to where they are supposed to be outside the unit cell, even if this goes outside of the desired plot range. An example is given below Cheers, Henrik
clear
CuO = spinw;
CuO.fileid(0)
CuO.genlattice('lat_const',[4.684 3.423 5.129],'angled',[90 99.54 90],'sym','C 2/c')
CuO.addatom('r', [1/4 1/4 0],'S', 1/2,'label','Cu','color','blue')
CuO.gencoupling
CuO.addatom('r', [0 0.416 1/4],'S', 0,'label','O','color','red')
CuO.plot('range',[2 1 2],'cellMode','inside')
swplot.plotchem('atom1','Cu','atom2','O','limit',4,'range',[2 1 2],'mode','bond')
There is the extend
option that you can set to false in case you don't want to plot bonds outside of the plotting range. However I realised it has a bug, I will try to fix it. Meanwhile you can delete individual bonds by using the swplot.findobj()
and swplot.delete()
functions.