Change font style in yyaxis subplots

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

Henrik Schädlich
Henrik Schädlich 2017년 11월 23일
Here is the figure. You can see the difference in the font style.
Solved it. I forgot to consider latex notation for the label properties.
ylabel('Imagin\"arteil', 'FontSize', 12,'interpreter','latex');
ylabel('Phase in $\circ$', 'FontSize', 12,'interpreter','latex');
Jan
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.
Yes, there is an error message.
Warning: Error updating Text.
Character vector must have valid interpreter syntax:
Phase in °
> In defaulterrorcallback (line 12)
In print (line 36)
In Auswertung (line 118)
Warning: Error updating Text.
Character vector must have valid interpreter syntax:
Imaginärteil von $\underline{Y}$
> In defaulterrorcallback (line 12)
In print (line 36)
In Auswertung (line 118)
>>

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

답변 (0개)

카테고리

질문:

2017년 11월 23일

댓글:

2017년 11월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by