EdgeLabels

EdgeLabels
is an option and property for Graph and related functions that specifies what labels and label positions should be used for edges.

DetailsDetails

  • The following option settings can be used:
  • Noneuse no edge labels
    {viUndirectedEdgevj->lblij,...}label edge with etc.
  • The wrapper Labeled[viUndirectedEdgevj, lbl] is equivalent to Property[viUndirectedEdgevj, EdgeLabels->lbl] and can be used when creating graphs in functions such as Graph etc.
  • Labeled[viUndirectedEdgevj, lbl, pos] and Placed[lbl, pos] can be used to place labels along an edge.
  • The following positions pos can be used for Labeled and Placed in positioning edge labels:
  • Tooltip,StatusAreashow as tooltip or in status area on mouseover
    "Start","Middle","End"place label at start, middle, or end
    {Left,pos},{Right,pos}place label left or right of the edge at symbolic position
    {s,{lx,ly}}scaled position in the label at scaled position s along the edge
  • The scaled position along the edge curve represents the fraction of the total length: e.g. places the edge label at the halfway point.

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

Label the edge :

In[1]:=
Click for copyable input
Out[1]=

Use any expression as a label:

In[1]:=
Click for copyable input
Out[1]=

Place a label along the edge:

In[1]:=
Click for copyable input
Out[1]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »