문제

I would like simply to plot labels not to the vertex of the graph but to the edge.

Simple enough case: Kamada Kawai layout for undirected graph.

I'm fantasizing about something like this:

visual_style["edge_label"] = g.es["weightthing"]

To try to justify my question as I was researching much but found only this:

The edge labels. They will be converted to character. Specify NA to omit edge labels.

Edge labels are omitted by default.

from here

I fail to understand the above quote. Sorry.

  • Is it possible to plot label to edge?
  • Aprox. how?
도움이 되었습니까?

해결책

Unfortunately edge labels are not supported yet in the Python interface of igraph. (By the way, you were reading the documentation for the R interface).

Update: the development version of igraph (i.e. version 0.7) now supports edge labels.

다른 팁

You can use NetworkX instead. (EDIT) You may like to use this function:

networkx.draw_networkx_edge_labels()

The docstring shows the use of the parameter edge_labels:

edge_labels : dictionary
       Edge labels in a dictionary keyed by edge two-tuple of text
       labels (default=None). Only labels for the keys in the dictionary
       are drawn.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top