Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

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
    "Index"use the edge index as a label
    "Name"use the edge name as a label
    "EdgeWeight"use the edge weight as a label
    {vivj->lblij,}label edge vivj with lblij etc.
  • The wrapper Labeled[vivj,lbl] is equivalent to Property[vivj,EdgeLabels->lbl] and can be used when creating graphs in functions such as Graph etc.
  • Labeled[vivj,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 {lx,ly} 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 12:

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]=
Introduced in 2010
(8.0)
| Updated in 2015
(10.2)