how to plot the imaginary part of an array numbers as a minus y-axis data

1 次查看(过去 30 天)
in developing a matlab code I need to plot the imaginary part of the frequency range in the negative y-axis range . the real part ( in the positive y-axis) and the imaginary part ( in the negative y- axis range)
here is the function in which the real part is ploted successfully, but the imag part is stuck
function []=plot_dispersion(Nk,k_norm,name_special_k,f)
f=real(f);
f1=imag(f);
max_nu=max(max(f));
plot(ones(100,1)*k_norm(1),linspace(0,max_nu*1.1,100),'k-','linewidth',2);
hold on;
for n=1:size(name_special_k,2)-1
plot(linspace(k_norm(n),k_norm(n+1),Nk),f(:,(n-1)*Nk+1:n*Nk),'b.');
plot(ones(100,1)*k_norm(n+1),linspace(0,max_nu*1.1,100),'k-','linewidth',2);
end
set(gca,'xtick',[],'fontsize',12);
ylabel('\nu (THz)','fontsize',12);
xlabel ( ' (wavevector) ' )
axis tight;
for n=1:size(name_special_k,2)
text(k_norm(n),-max_nu*0.05,name_special_k(n),...
'interpreter','latex','fontsize',12);
end
  5 个评论

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by