xticks/yticks函数,后面加上你想标的点坐标
例如:(代码中加粗为重点,希望在坐标轴上标明的点为(1Ghz,-3db)(1.561Ghz,-70db),(1.616Ghz,-70db)
a=load(“S21.txt”);
S21=zeros(1001,6);
k=ones(1001,1)*(-3)
for i=1:6
S21(:,i)=a(((i-1)1001+1):i1001,2);
end
m=a(1:1001,1);
figure (1)
plot(m,S21(:,1),‘g’);
hold on
plot(m,S21(:,2),‘y’);
hold on
plot(m,S21(:,3),‘k’);
hold on
plot(m,S21(:,4),‘r’);
hold on
plot(m,S21(:,5),‘b’);
hold on
plot(m,S21(:,6),‘m’);
hold on
plot(m,k,‘m:’);
hold on
plot([1.561,1.561],[-70,0],‘k–’);
hold on
plot([1.616,1.616],[-70,0],‘k–’);
leg=legend(‘单元1’,‘单元2’,‘单元3’,‘单元4’,‘单元5’,‘单元6’);
xlabel(‘频率/GHZ’);
ylabel(‘透射系数/db’);
set(leg,‘Location’,‘southwest’);
yticks([-70,-60,-50,-40,-30,-20,-10,-3,0]);
xticks([1,1.2,1.4,1.561,1.616,1.8,2]);
结果图