How to make the axis labels of a plot BOLD

669 ビュー (過去 30 日間)
Shahab Khan
Shahab Khan 2021 年 10 月 9 日
編集済み: Ryszard Lukaszuk 2022 年 4 月 26 日
I am trying to plot some figures. Generally the axis labels of the figure are in standard size font. Now I know that I can make them bold by going through Edit > Axes Properties. But I would like it to be done within the matlab code.
I am aware of this peice of code, but i am not sure how to implement it into my plotting code.
FontWeight — Character thickness
'normal' (default) | 'bold'
MY general plot code is
figure('Name','Test Figure','NumberTitle', 'off')
hold on;
plot(a, x,'--k','linewidth',2);
plot(b, y , 'b','linewidth',2);
ylabel('percentage')
xlabel('distance')
title('Corelation')
legend('dist','Percentage')

採用された回答

Star Strider
Star Strider 2021 年 10 月 9 日
The axis lables and titles are text objects.
Try something like this —
x = 1:10;
y = randn(size(x));
figure
plot(x, y)
grid
xlabel('X Label')
ylabel('Y Label', 'FontWeight','bold')
.
  4 件のコメント
Haseeb Hashim
Haseeb Hashim 2022 年 3 月 28 日
can we make the values of x axis bold ????
Ryszard Lukaszuk
Ryszard Lukaszuk 2022 年 4 月 26 日
編集済み: Ryszard Lukaszuk 2022 年 4 月 26 日
@Haseeb Hashim xlabel('X Label', 'FontWeight','bold')

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by