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
댓글 수: 5
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!