python-igraph icon indicating copy to clipboard operation
python-igraph copied to clipboard

Edge "label_dist" not working

Open arjunr2 opened this issue 2 years ago • 1 comments

Describe the bug Setting the "label_dist" on Edge doesn't change rendering

To reproduce

from igraph import *
import math

if __name__ == '__main__':
    g = Graph(directed=True)
    g.add_vertices(4)
    g.add_edges([(2,0), (1,3), (3,1), (0, 1), (1,0)])
    g.vs["name"] = ["A", "B", "C", "D"]
    g.vs["label"] = g.vs["name"]
    #
    g.es["label"] = ["c1", "c2", "c3", "c4"]
    g.es["curved"] = 0.2
    g.es["label_color"] = "blue"
    g.es["label_angle"] = math.pi * 0.5
    # This Feature doesn't work
    g.es["label_dist"] = 2

    visual_style = {}
    visual_style["vertex_size"] = 80
    visual_style["bbox"] = (1000, 700)
    visual_style["margin"] = 60

    print(g)
    layout = g.layout("kk")
    plot(g, **visual_style, layout=layout)

Version information igraph 0.9.9 installed using pip

arjunr2 avatar Feb 10 '22 22:02 arjunr2

label_dist is currently not listed in the list of attributes that affect plotting (see here ). It would be a nice addition, though, so I'm adding it to the wishlist.

ntamas avatar Feb 11 '22 08:02 ntamas