On Fri, 3 Oct 2014, Nathann Cohen wrote:
>> A ticket about this:
http://trac.sagemath.org/ticket/15206 . This is
>> not related to posets only, but to graphs in general. Is anyone
>> planning to do this?
> I do not understand: do you only want to draw a graph with "anything you
> want" as labels of the vertices ?
Yes. Just like adges can be labelled so that more than one edge has same
label:
G=DiGraph({0:[1,2]})
G.set_edge_label(0,1,'Hi!')
G.set_edge_label(0,2,'Hi!')
(But ".relabel(lambda e: ...)" -syntax is easier, I think.)
> If so, I have no idea why it seems to have been half-implemented in the
> posets file. That's clearly a Graph matter, which Posets would then call.
> This being said, you should not make this work by relabelling the graph
> itself: if several vertices of a graph have the same name, we would have no
> way to do things as simple as getting the degree of a vertex.
>
> This being said, there is in Graph.plot() an option currently named
> vertex_labels which can be set to True/False according to whether you want
> to display the vertices' labels when the graph is drawn. If you just make it
> accept a dictionary of labels, there must then be a way to plot the labels
> you gave this way instead of the vertices' names.
Sounds like a great plan! Now we just wait for somebody to do it!
I will not, not at least in any near future.
* * *
Btw, why default color changes when you give color of one element? See
G=DiGraph({0:[1]})
G.show(vertex_colors='pink')
G.show(vertex_colors={'red':[0]})
changing background color of "1".
--
Jori Mäntysalo