我尝试添加第二个x轴,它可以只是第一个x的副本,相同的数据。 但是当我添加轴时它不会改变y位置,如同指定的那样,它也会改变x并且轴本身被切割,不可见
f = 10;
N=[3,5,8,13];
eff_t(1) = 12.4758 - j *6.5914;
eff_f(1) = 12.4615;
n_t(1) = 0.0298;
n_est(1) = 0.0321;
eff_f(2) = 12.3662 - j *7.473;
eff_t(2) = 12.3532 - j *6.5202;
n_t(2) = 0.0496;
n_est(2) = 0.0475;
eff_f(3) = 12.0535 - j *6.327;
eff_t(3) = 12.1708 - j *6.4143;
n_t(3) = 0.0794;
n_est(3) = 0.0987;
eff_f(4) = 12.0328 - j *6.4102;
eff_t(4) = 11.8707 - j *6.2402;
n_t(4) = 0.12;
n_est(4) = 0.10;
figure(1)
yyaxis left
plot(N, eff_f,'b-o', N, eff_t, 'r-o','Linewidth',2);
ylabel('Realteil der rel. Permittivität \epsilonS und \epsilonMG');
yyaxis right
plot(N, n_est, 'k--o',N, n_t,'g--o','Linewidth',2);
ylabel('Porosität nS und nMG');
legend('\epsilonS','\epsilonMG','nS','nMG');
grid on
%grid minor
set(gca,'FontSize', 20);
set(gca,'Linewidth',1.8);
xlabel('N Anzahl der Poren');
title('Permittivität und Porosität für f = 10 GHz');
a1Pos = get(gca,'Position');
%// Place axis 2 below the 1st.
ax2 = axes('Position',[a1Pos(1) (a1Pos(2)-0.3) a1Pos(3) a1Pos(4)],'Color','none','YTick',[],'YTickLabel',[]);