% DISPRELPLOT plots dispersion relations. 
%
% DISPRELPLOT(omega, k, species)
%
% omega:     vector containing the complex angular frequency
% k:         wave number vector which is to be plotted
% species:   string which determines the subscript of the reference
%            frequency. Use 'e' for electron plasma frequency, 'i' for
%            ion plasma frequency.

function disprelplot(omega, k, species)

if nargin<3
  ref='ref';
else
  if strcmp(species(1),'e')
    ref='pe';
  else
    ref='pi';
  end
end

ss=size(omega);

col='rgmbkc';

subplot(2,1,1)
hold on
for mode=1:ss(1)
  mod6=mod(mode,6)+1;
  if real(omega(mode,2)) > 0
    plot(k,real(omega(mode,:)), [col(mod6) '-'])
  else,
    plot(-k,-real(omega(mode,:)), [col(mod6) '-'])
  end
end
set(gca,'fontname','times','fontsize',14)
xlabel('k\lambda_{De}','fontname','times','fontsize',18)
ylabel(['\Re(\omega)/\omega_{' ref '}'],'fontname','times','fontsize',18)
hold off

subplot(2,1,2)
hold on
for mode=1:ss(1)
  mod6=mod(mode,6)+1;
  if real(omega(mode,2)) > 0
    plot(k,imag(omega(mode,:)), [col(mod6) '-'])
  else
    plot(-k,imag(omega(mode,:)),[col(mod6) '-'])
  end
end
set(gca,'fontname','times','fontsize',14)
xlabel('k\lambda_{De}','fontname','times','fontsize',18)
ylabel(['\Im(\omega)/\omega_{' ref '}'],'fontname','times','fontsize',18)
hold off
