필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
zina shadidi
zina shadidi 2021년 10월 5일
댓글: Mathieu NOE 2021년 10월 7일
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
zina shadidi
zina shadidi 2021년 10월 6일
Thanks a lot , Mathieu NOE
interp1 was a good choice, and my problem solved.

댓글을 달려면 로그인하십시오.

답변 (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