is an option and annotation for Graph and related functions that specifies a function to use to generate primitives for rendering each edge.


  • The following option settings can be used:
  • Automaticthe default edge function
    Nonedo not render edges
    "name"a named edge function
    funca general edge function
    {vivj->efij,}use edge function efij for edge vivj
    {pattiefi,}use edge function efi for edges matching the pattern patti
  • The wrapper Annotation[vw,EdgeShapeFunction->f] can be used when creating graphs in functions such as Graph etc.
  • Use ResourceData["EdgeShapeFunction"] to get a list of all named edge functions.
  • EdgeShapeFunction->func specifies that each edge should be rendered with the primitives provided by func[{{x1,y1},{x2,y2},},vw], where {{x1,y1},{x2,y2},} are line segments and vw is the edge.


open allclose all

Basic Examples  (4)

Draw edges using a predefined edge function:

Specify an edge function for an individual edge:

Combine with a different default edge function:

Use an Annotation wrapper to specify individual edge functions:

Draw edges by running a program:

Scope  (10)

EdgeShapeFunction Specification  (7)

EdgeShapeFunction can be used for general graphs:

Matrix graphs:

Special graphs:

Random graphs:

Use EdgeShapeFunction in an Annotation wrapper:

EdgeShapeFunction works with patterns:

EdgeShapeFunction can be combined with EdgeStyle:

EdgeShapeFunction has higher priority than EdgeStyle:

EdgeShapeFunction Gallery  (3)

Get a list of built-in settings for EdgeShapeFunction:

Undirected edges including the basic line:

Lines with different glyphs on the edges:

Directed edges including solid arrows:

Line arrows:

Open arrows:

Possible Issues  (1)

Using Rule to indicate edges does not work:

Use parentheses to get correct parsing:

Wolfram Research (2010), EdgeShapeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeShapeFunction.html.


Wolfram Research (2010), EdgeShapeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeShapeFunction.html.


Wolfram Language. 2010. "EdgeShapeFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EdgeShapeFunction.html.


Wolfram Language. (2010). EdgeShapeFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeShapeFunction.html


@misc{reference.wolfram_2024_edgeshapefunction, author="Wolfram Research", title="{EdgeShapeFunction}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeShapeFunction.html}", note=[Accessed: 20-June-2024 ]}


@online{reference.wolfram_2024_edgeshapefunction, organization={Wolfram Research}, title={EdgeShapeFunction}, year={2010}, url={https://reference.wolfram.com/language/ref/EdgeShapeFunction.html}, note=[Accessed: 20-June-2024 ]}