
load pdrk_wk0;
load wk;

%%
% h = figure('Unit','Normalized','position',...
%     [0.02 0.3 0.6 0.6],'DefaultAxesFontSize',15);

subplot(122);

% hold on;
jn=length(kk);
jj=1:3:jn;
plot(kk(jj),real(ww(1,jj)),'r+',kk(jj),real(ww(2,jj)),'r+',kk(jj),real(ww(3,jj)),...
    'r+',kk(jj),real(ww(4,jj)),'r+','LineWidth',2);
hold on;

yg=Egt;
ygf=fft2(yg);
tgf=1/dt.*linspace(0,1,nt);
kgf=1/dx.*linspace(0,1,ng);
% tgf=tgf*wp*2*pi; %
% kgf=kgf*wp*2*pi; %
tgf=tgf/wc*2*pi; %
kgf=kgf/wc*2*pi; %
[tgff,kgff]=meshgrid(tgf,kgf);

pk=max(max((abs(ygf))));
ind=find(abs(ygf)<pk/200);
ygf1=ygf;
ygf1(ind)=NaN;
% pcolor(kgff,tgff,(abs(ygf1))); shading interp; %colormap(hsv);
% pcolor(kgff,tgff,(abs(ygf))); shading interp; % colormap(gray);
contour(kgff,tgff,abs(ygf));  shading interp;
% surf(kgff,tgff,abs(ygf));
xlim([0,5]); ylim([0,5]);
xlabel('k\rho_c'); ylabel('\omega/\omega_c');

% plot(tf,abs(yf),'LineWidth',2);
for jp=1:5
    hold on; plot([0,5],[jp,jp],'g--','LineWidth',2);
end


% title(['(b) PIC spectral vs. PDRK, \Delta{k}=',num2str(kgf(2)-kgf(1)),...
%     ', \Delta\omega=',num2str(tgf(2)-tgf(1))]);
title('(b) PIC spectral vs. PDRK');

print(gcf,'-dpng',['pices1d3v_np',num2str(np),'_wc',num2str(wc),...
    '_k',num2str(kwc),'_dt',num2str(dt),'_nt',num2str(nt),'_wk.png']);

