Question

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?
Was it helpful?

Solution

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.

OTHER TIPS

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top