Ask Your Question

Graph edge label: formatting possibilities

asked 2015-01-09 13:05:52 +0200

herb gravatar image

updated 2015-01-09 13:12:43 +0200

I have a graph with like this and would like to format ( e.g. color ) the edge labels more individual. Is it possible for example to make from 'a|b' the 'a' red and 'b' blue? Also different font types ( bold, italic ) etc would be interesting.

G = Graph(multiedges=True)
G.add_edges( [(0,1,'a|b'),(1,2,'c|d'),(2,3,'e|f'),(3,4,'g|h'),(4,0,'i|j')] )
H = G.plot(edge_labels=True, graph_border=True)

When I remember correctly, there is (limited) support for TeX-formatting, could this be used somehow to achieve the formatting?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-09 13:43:10 +0200

Nathann gravatar image

The part of your question related to colors is answered there:

edit flag offensive delete link more


But the solution mentioned there does not allow to colorize sub-strings within the label differently, right?

herb gravatar imageherb ( 2015-01-09 14:28:16 +0200 )edit

No, it colors the edges, not the text.

Nathann gravatar imageNathann ( 2015-01-10 07:29:00 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-01-09 13:05:52 +0200

Seen: 885 times

Last updated: Jan 09 '15