How to make the axis labels of a plot BOLD

410 visualizaciones (últimos 30 días)
Shahab Khan
Shahab Khan el 9 de Oct. de 2021
Editada: Ryszard Lukaszuk el 26 de Abr. de 2022
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')

Respuesta aceptada

Star Strider
Star Strider el 9 de Oct. de 2021
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 comentarios
Haseeb Hashim
Haseeb Hashim el 28 de Mzo. de 2022
can we make the values of x axis bold ????
Ryszard Lukaszuk
Ryszard Lukaszuk el 26 de Abr. de 2022
Editada: Ryszard Lukaszuk el 26 de Abr. de 2022
@Haseeb Hashim xlabel('X Label', 'FontWeight','bold')

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by