How to make ticks labels (the numbers, not the axis labels.) bold when using latex interpreter.

169 次查看(过去 30 天)
I applied latex interpreter to axis numbers. But I can not make the axis numbers bold, set(gca,'fontweight','bold') doesn't work. The following is my code:
tt = 0:.01:5;
y1 = sin(pi*tt);
y2 = cos(pi*tt);
figure
p1 = plot(tt,y1,'linewidth',1.5); grid on, hold on
p2 = plot(tt,y2,'linewidth',1.5);
set(gca,'TickLabelInterpreter','latex');
set(gca,'fontweight','bold','fontsize',12) % This line I want to make axes number bold
legend([p1 p2],{'\textbf{Sin}','\textbf{Cos}'},'fontsize',12,'interpreter','latex','location','northeast')
xlabel('\bf{Time [sec]}','fontsize',14,'interpreter','latex')
ylabel('\bf{Amplitude [m]}','fontsize',14,'interpreter','latex')
I have already made the axis labels bold. So don't tell me how to do this. Pleas focus on the ticklabels, which are the numbers showing on the x y axis, such as 1,2,3,4...

回答(1 个)

Bjorn Gustavsson
Bjorn Gustavsson 2021-2-16
This seems to work in general:
set(gca,'fontweigth','bold')
HTH
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by