# Ornementation in Graph

 A simple question due to my incompetence. In the following graph
g2={0:[1,2],1:[3],2:[],3:[0]}
strongly_connected_components(g2)
H2=DiGraph(g2)
show(H2.vertices())
H2.relabel({0:'A' , 1:'B', 2:'C', 3:'D'})
show(H2.vertices())
#H2.show(vertex_color='green',vertex_colors={'red': [0,1,3]},edge_colors={(.5,.25,.5):[('1',3,None),(1,3,None),(3,0,None)],(.25,.75,.25):[(0,2,None)]})
H2.show(vertex_color='green',vertex_colors={'red': ['A','B','D']},edge_colors={(.5,.25,.5):[('A','B',None),('B','D',None),('D','A',None)],(.25,.75,.25):[('A','C',None)]})


what means None (I have'nt found in the documentation. And is it possible to print the vertex like a LaTeX expression.

edit retag close merge delete

None est l'étiquette par défaut des arêtes dans les graphes. C'est équivalent à l'absence d'étiquette.

( 2021-03-15 17:45:03 +0100 )edit

Sort by » oldest newest most voted

These are edge labels. Each edge is described by a 3-element tuple $(s,t,l)$ where $s$ and $t$ are start/end vertices, and $l$ in a label. None means that there is no label.

more

Same answer that the one of FrédéricC. But for LaTex rendering ?

( 2021-03-16 11:19:01 +0100 )edit

According to https://doc.sagemath.org/html/en/refe...

Vertex Labels: can use latex formatting, and may have their colors specified, including on a per-vertex basis

( 2021-03-16 23:52:01 +0100 )edit