Ask Your Question
0

Graph edge label: formatting possibilities

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

herb gravatar image

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

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)
H.show()

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
1

answered 2015-01-09 06:43:10 -0600

Nathann gravatar image

The part of your question related to colors is answered there: http://ask.sagemath.org/question/2541...

edit flag offensive delete link more

Comments

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 -0600 )edit

No, it colors the edges, not the text.

Nathann gravatar imageNathann ( 2015-01-10 00:29:00 -0600 )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

Stats

Asked: 2015-01-09 06:05:52 -0600

Seen: 268 times

Last updated: Jan 09 '15