Ask Your Question
0

Graph edge label: formatting possibilities

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

herb gravatar image

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

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 13:43:10 +0100

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 14:28:16 +0100 )edit

No, it colors the edges, not the text.

Nathann gravatar imageNathann ( 2015-01-10 07:29:00 +0100 )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 13:05:52 +0100

Seen: 943 times

Last updated: Jan 09 '15