Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Styling, Labeling, and Layout > EdgeLabels >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Styling, Labeling, and Layout > EdgeLabels >

EdgeLabels

EdgeLabels
is an option and property for Graph and related functions that specifies what labels and label positions should be used for edges.
  • The following option settings can be used:
Noneuse no edge labels
{viUndirectedEdgevj->lblij,...}label edge with etc.
  • The wrapper Labeled is equivalent to Property and can be used when creating graphs in functions such as Graph etc.
  • 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 of 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.
Label the edge :
Use any expression as a label:
Place a label along the edge:
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]=
Label all edges:
EdgeLabels can be used for general graphs:
Matrix graphs:
Special graphs:
Random graphs:
Use EdgeLabels in a Property wrapper:
Alternatively, use a Labeled wrapper:
Use Placed with symbolic locations to control label placement along an edge:
Use explicit coordinates to place labels:
Place multiple labels using Placed in a wrapper:
Any number of labels can be used:
Place multiple labels using EdgeLabels:
Use automatic labeling by values through Tooltip and StatusArea:
Using Rule to indicate edges does not seem to work:
Use parentheses to get correct parsing:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF