Change position of Graph edge label and node label

조회 수: 13 (최근 30일)
Marc Gebhardt
Marc Gebhardt 2021년 1월 20일
답변: Christine Tobler 2021년 1월 20일
Hi, i plotted a graph with node labels and edge labels.
Now, all edge labels are above the linking line, all node labels are in "the west" of each node-point.
How can I change this for each node seperately or for all nodes or edges in all?

답변 (1개)

Christine Tobler
Christine Tobler 2021년 1월 20일
The position of the labels that are part of the graph plot can't be modified. It's possible to create independent text labels and move these to the positions of the graph's nodes. Here's a post describing how that would work:
You can then manipulate the positions either by assigning to the properties of that text object's handle, or by moving the labels by hand.
For the edges, the same is possible, you would probably want to compute the mid-point between the source and target node's coordinates in that case.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by