Here is the figure. You can see the difference in the font style.
Change font style in yyaxis subplots
조회 수: 4 (최근 30일)
이전 댓글 표시
I would like to change the label font to latex style. But somehow the style does not change for the yaxis in the subplots. Any advice. Best regards Henrik
See the code. data attached.
Aktor = importdata(['Aktor1.w_l']);
Aktor_freq = Aktor(:,1);
Aktor_ampl = Aktor(:,2);
Aktor_phase = Aktor(:,3);
Aktor_length = length(Aktor(:,1));
fig = figure (1);
set(fig, 'Units', 'normalized', 'Position', [0.2, 0.1, 0.5, 0.3]);
%%Plot Ampl- und Phasengang
ax1 = subplot(121)
x1 = Aktor_freq;
xlim([Aktor(1,1) Aktor(Aktor_length,1)]);
xlabel('Frequenz in Hz', 'FontSize', 12,'interpreter','latex');
y11 = Aktor_ampl;
y12 = Aktor_phase;
yyaxis left
semilogy(x1,y11,'LineWidth',1.5);
ylabel('Admittanz in S', 'FontSize', 12,'interpreter','latex');
grid on
yyaxis right
plot(x1,y12,'LineWidth',1.5);
ylabel('Phase in °', 'FontSize', 12,'interpreter','latex');
%%Imaginär und Realteil
ax2 = subplot(122);
x2 = Aktor_ampl.*cos(deg2rad(Aktor_phase));
y21 = Aktor_ampl.*sin(deg2rad(Aktor_phase));
plot(x2,y21,'LineWidth',1.5);
xlabel('Realteil', 'FontSize', 12,'interpreter','latex');
ylabel('Imaginärteil', 'FontSize', 12,'interpreter','latex');
grid on;
print('-dpng', ['Amp und Phase Aktor' num2str(iAktor) '.png'], '-r500');
end
댓글 수: 4
Jan
2017년 11월 23일
@Henrik: Very nice! When the latex interpreter fails, the text is displayed without interpretation and this changes the font also. Do you get a warning message in the command window? If not, it is worth to send an enhancement request to MathWorks.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!