figure(1);
clf
set(gcf,'Position',[237 434 746 420])
h=4.13567e-12;  % meV*s
maxf=16e12;
maxe=16e12*h;
ylabel('freq [Hz]')

load -ascii siphonons.txt
k100=siphonons(1:6,1)';
k110=siphonons(7:13,2)';
k111=siphonons(14:19,1)';
kdat=[k100 sqrt(2)*k110 sqrt(3)*k111];

% this mumbo-jumbo tranformation is necessary for plotting
kplot=zeros(1,19);
kdiff=abs(diff(kdat));
for i=2:19,
  kplot(i)=sum(kdiff(1:i-1));
end

todat=siphonons(:,4)*1e12;  toerr=siphonons(:,5)*1e12;
lodat=siphonons(:,6)*1e12;  loerr=siphonons(:,7)*1e12;
tadat=siphonons(:,8)*1e12;  taerr=siphonons(:,9)*1e12;
ladat=siphonons(:,10)*1e12; laerr=siphonons(:,11)*1e12;
hold on
h=errorbar(kplot,todat,toerr,'bo-');
set(h,'MarkerSize',4)
set(h,'MarkerFaceColor','blue')
h=errorbar(kplot,lodat,loerr,'ro-.');
set(h,'MarkerSize',4)
set(h,'MarkerFaceColor','red')
h=errorbar(kplot,tadat,taerr,'bo-');
set(h,'MarkerSize',4)
set(h,'MarkerFaceColor','blue')
h=errorbar(kplot,ladat,laerr,'ro-.');
set(h,'MarkerSize',4)
set(h,'MarkerFaceColor','red')

% draw vertical lines at major breakpoints
plot(kplot(6)*ones(1,10),linspace(0,maxf,10),':')
plot(kplot(8)*ones(1,10),linspace(0,maxf,10),':')
plot(kplot(14)*ones(1,10),linspace(0,maxf,10),':')

[ax,h1,h2]=plotyy(kplot,zeros(1,19),kplot,zeros(1,19));
hold off

axes(ax(1))
axis([0 max(kplot) 0 maxf])
axes(ax(2))
axis([0 max(kplot) 0 maxe])

set(ax(1),'XTick',kplot)
klabels=[k100 k110 k111];
set(ax(1),'XTickLabel',klabels)
set(ax(1),'YTick',0:2e12:maxf)
set(ax(1),'XColor',[0 0 0])
set(ax(1),'Box','off')
set(ax(1),'YColor',[0 0 0])

set(ax(2),'XTick',kplot)
set(ax(2),'XColor',[0 0 0])
set(ax(2),'XAxisLocation','top')
set(ax(2),'XTickLabel',[])
set(ax(2),'YTick',0:10:maxe)
set(ax(2),'YColor',[0 0 0])
ylabel('energy [meV]')

% write the high-symmetry point labels
h=text(-.03,-5,'\Gamma');
set(h,'FontSize',14)
h=text(.97,-5,'X');
set(h,'FontSize',14)
h=text(1.33,-5,'K');
set(h,'FontSize',14)
h=text(2.38,-5,'\Gamma');
set(h,'FontSize',14)

text(.42,-5,'[100]')
text(1.78,-5,'[110]')
text(2.8,-5,'[111]')
