how to change the size of the fonts inside the bar graph
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tony Cheng
le 13 Mai 2025
Modifié(e) : Chuguang Pan
le 13 Mai 2025
Hi there,
I am using the bar code to draw a bar graph. So how to change the size of the fonts inside the graph, as shown in the attachment?
Many thanks!
Cheers
0 commentaires
Réponse acceptée
Chuguang Pan
le 13 Mai 2025
Modifié(e) : Chuguang Pan
le 13 Mai 2025
x = [1 2 3];
vals = [2 3 6; 11 23 26];
b = bar(x,vals);
xtips1 = b(1).XEndPoints;
ytips1 = b(1).YEndPoints;
labels1 = string(b(1).YData);
text(xtips1,ytips1,labels1,'HorizontalAlignment','center',...
'VerticalAlignment','bottom','FontSize',15)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Discrete Data Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
