-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_band.m
29 lines (28 loc) · 1.24 KB
/
plot_band.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function plot_band(kpoint, energy, hsp, hsp_label, node, sys_name, fermi, color)
plot(kpoint(:,5), energy,color)
x_value = get(gca, 'XTick');
y_value = get(gca, 'YTick');hold on
set(gca,'XTick', [], 'XTickLabel', []);
for ii = 1:size(hsp,1)/2
% text(kpoint(node*(ii-1)+1,5)-0.01*(x_value(end)-x_value(1)),...
% y_value(1), hsp_label{2*(ii-1)+1}, 'fontsize', 13)
% text(kpoint(node*ii,5)-0.01*(x_value(end)-x_value(1)),...
% y_value(1), hsp_label{2*ii}, 'fontsize', 13)
line([kpoint(node*(ii-1)+1,5) kpoint(node*(ii-1)+1,5)], [y_value(1) y_value(end)], 'color','r','linestyle','--');
line([kpoint(node*ii,5) kpoint(node*ii,5)], [y_value(1) y_value(end)],'color','r','linestyle','--');
end
n = 1;
for ii = 1:size(hsp,1)/2
kpts_label(n) = kpoint(node*(ii-1)+1,5);
kpts_label(n+1) = kpoint(node*ii,5);
n = n + 2;
end
[kpts_label,q] = unique(kpts_label);
hsp_label = hsp_label(q);
set(gca, 'XTick', kpts_label,...
'XTickLabel', hsp_label, 'fontsize', 13)
line([x_value(1) x_value(end)], [fermi fermi],'color','g','linestyle','--');
% text(x_value(1)-x_value(end)/15,0,'E_f')
axis([kpoint(1,5) kpoint(end,5) fermi-4 fermi+4])
% energy_gap(energy_gap<0) = 0;
title(['Band Structure of ', sys_name])