Ask Your Question

Graph edge label: formatting possibilities

asked 2015-01-09 06:05:52 -0500

herb gravatar image

updated 2015-01-09 06:12:43 -0500

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 06:43:10 -0500

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 07:28:16 -0500 )edit

No, it colors the edges, not the text.

Nathann gravatar imageNathann ( 2015-01-10 00:29:00 -0500 )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 06:05:52 -0500

Seen: 230 times

Last updated: Jan 09 '15