how to plot the imaginary part of an array numbers as a minus y-axis data
2 次查看(过去 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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!