How to make the axis labels of a plot BOLD

482 次查看(过去 30 天)
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by