rotation of graph node labels

조회 수: 20 (최근 30일)
Roy Goodman
Roy Goodman 2020년 7월 4일
댓글: Roy Goodman 2020년 7월 7일
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.

채택된 답변

Christine Tobler
Christine Tobler 2020년 7월 6일
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
Roy Goodman
Roy Goodman 2020년 7월 7일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sugar Daddy
Sugar Daddy 2020년 7월 4일
  댓글 수: 1
Roy Goodman
Roy Goodman 2020년 7월 7일
Thanks. That's a lot to do by hand!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by