font format in second y-axis

7 views (last 30 days)
Yub3r
Yub3r on 29 Mar 2017
Answered: Chibuzo Nnonyelu on 27 Jan 2018
Hello,
how can I change the font-style of the numbers of my second y-axis? For the first it is no problem for me. I want the font LaTeX.
I have following matlab-code:
if true
figure;
hold on;
grid on;
[ax, h1, h2] = plotyy(t, y1, t, y2);
set(gca, 'FontName', 'Times New Roman');
set(get(gca, 'xlabel'), 'interpreter', 'latex');
set(get(gca, 'xlabel'), 'FontName', 'latex');
set(get(gca, 'ylabel'), 'interpreter', 'latex');
set(get(gca, 'ylabel'), 'FontName', 'latex');
set(legend(), 'interpreter', 'latex');
set(legend(), 'FontName', 'latex');
set(gcf, 'WindowStyle', 'normal');
set(get(gca, 'ylabel'), 'interpreter', 'latex');
set(get(gca, 'ylabel'), 'FontName', 'latex');
set(ax(2), 'FontName', 'latex');
set(ax,{'ycolor'},{'k';'k'})
set(gca,'ytick',[-100:10:100])
set(ax(2),'YTick',[-100:20:100])
end
Thank you!

Answers (3)

Yub3r
Yub3r on 30 Mar 2017
Can someone help?

Kenneth Harp
Kenneth Harp on 7 Apr 2017
I have the same query....

Chibuzo Nnonyelu
Chibuzo Nnonyelu on 27 Jan 2018
To label the axis in LaTeX font or style, use
set(gca, 'DefaultTextInterpreter', 'Latex');
This makes all LaTeX the default interpreter for all the axes.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!

Translated by