|
发表于 2023-5-24 22:57:56
|
显示全部楼层
- % First run vaspkit (version => 1.2.3) with task 216, 257 or 285 to get MOMENTUM.grd, ENERGY.grd and WEIGHT.grd
- clc;clear;clear all;
- momentum=load('MOMENTUM.grd');
- energy=load('ENERGY.grd');
- weight=load('WEIGHT.grd');
- ymin=-5.0;
- ymax=5.0;
- fig_title =' Nb-d' ;
- % Read content from KLABELS, assign values to kpoint_value and k_value
- fid = fopen('KLABELS','r');%打开文件句柄
- FormatString='%s';
- High_Symmetry_Kpoints=textscan(fid,FormatString,'HeaderLines',1,'Delimiter',''); %跳过第1行,以空格为数据的分隔符
- High_Symmetry_Kpoints{1}(end)=[]; %删除最后一行
- %初始化
- kpoint_value = cell(1,length(High_Symmetry_Kpoints{1}));
- k_value = length(High_Symmetry_Kpoints{1});
- fclose(fid);%关闭文件句柄
- for i = 1:length(High_Symmetry_Kpoints{1})
- a = strsplit(High_Symmetry_Kpoints{1,1}{i,1},' ');
- kpoint_value(i) = a(1);
- k_value(i) = str2double(cell2mat(a(2)));
- end
- momentum_min = min(momentum(:));
- momentum_max = max(momentum(:));
- k_value(length(k_value))=momentum_max;
- k_value(1)=momentum_min;
- energy_min = min(energy(:));
- energy_max = max(energy(:));
- colormap('jet')
- set(gca,'Fontsize',20)
- %subplot(1, 5,subfig_number)
- fig = pcolor(momentum, energy, weight);
- shading interp;
- set(fig, 'LineStyle', 'none')
- title(fig_title)
- ylabel('E-E_F (eV)')
- ylim([ymin ymax]);
- set(gca,'ytick',ymin:1:ymax)
- set(gca, 'XTickLabel', kpoint_value , 'XTick', k_value,'Fontname', 'Times newman','Fontsize',20)
- line([momentum_min momentum_max], [0 0], 'LineStyle', '--', 'Color', 'w', 'LineWidth',1)
- for a=2:1:length(k_value)-1
- line([1 1]*k_value(a), [energy_min energy_max], 'LineStyle', '--', 'Color', 'w', 'LineWidth',1)
- end
复制代码 |
|