Change font size of node name in a graph

22 Ansichten (letzte 30 Tage)
Le Thi Khuyen
Le Thi Khuyen am 17 Mär. 2019
Kommentiert: Souarv De am 8 Apr. 2021
Hello,
Is there any one knows how to change the font size of node name in a graph, please!
I see that we can change many graphical characteristics by using the option 'Edit', but I can not find any option to change the font size of node names.
Could you help me, please!
Thanks,
Khuyen

Akzeptierte Antwort

Josh Meyer
Josh Meyer am 20 Mär. 2019
Several new properties were added to GraphPlot objects in R2018b to enable customization of node and edge labels. In particular you can change the font size with the NodeFontSize and EdgeFontSize properties.
A list of all the properties is here: GraphPlot Properties
Example:
G = graph([1 1 1 1 5 5 5 5],[2 3 4 5 6 7 8 9]);
h = plot(G,'NodeLabel',{'A','B','C','D','E','F','G','H','I'});
h.NodeFontSize = 14;
  4 Kommentare
Le Thi Khuyen
Le Thi Khuyen am 20 Mär. 2019
It works very well. Thank you so much!
Souarv De
Souarv De am 8 Apr. 2021
This is not available in R2018a.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by