rotation of graph node labels

20 visualizzazioni (ultimi 30 giorni)
Roy Goodman
Roy Goodman il 4 Lug 2020
Commentato: Roy Goodman il 7 Lug 2020
I am plotting some graphs using circular layout, for example
plot(digraph([1 2 3],[2 3 1]),"layout","circle");axis equal
The node labels come out rotated. I can't find a property to set in order to make them stand up straight.

Risposta accettata

Christine Tobler
Christine Tobler il 6 Lug 2020
The labels will be straight in most layouts (all but 'circle', 'layered'). You can first use 'circle' layout and then convert to having no layout and instead setting x, y data explicitly:
p = plot(G, 'Layout', 'circle');
p.XData = XData;
This will make the labels stand straight.
  1 Commento
Roy Goodman
Roy Goodman il 7 Lug 2020
Thanks. I find this to be more useful than the first answer. An accessible text rotation property would be more useful. This works but it messes up the label positions which were fine.

Accedi per commentare.

Più risposte (1)

Sugar Daddy
Sugar Daddy il 4 Lug 2020

Categorie

Scopri di più su Graph and Network Algorithms in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by