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

175 ビュー (過去 30 日間)
Red Li
Red Li 2018 年 6 月 21 日
コメント済み: Khalid Alsinan 2022 年 7 月 17 日
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 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 5 月 11 日
Oops, dumb fingers of mine.
Glad that it helped.
Khalid Alsinan
Khalid Alsinan 2022 年 7 月 17 日
How to only label some ticks and not all?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGrid 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