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

175 Ansichten (letzte 30 Tage)
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...

Antworten (1)

Bjorn Gustavsson
Bjorn Gustavsson am 16 Feb. 2021
This seems to work in general:
set(gca,'fontweigth','bold')
HTH
  3 Kommentare

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by