EdgeRenderingFunction
is an option for GraphPlot and related functions that gives a function to generate the graphics primitives to use in rendering each edge.
EdgeRenderingFunction
EdgeRenderingFunction
is an option for GraphPlot and related functions that gives a function to generate the graphics primitives to use in rendering each edge.
Details
- EdgeRenderingFunction->g specifies that each edge should be rendered with the graphics primitives given by g[{ri,…,rj},{vi,vj},lblij], where ri, rj are the beginning and ending points of the edge, vi, vj are the beginning and ending vertices, the lblij is any label specified for the edge.
- The graphics primitives obtained by applying EdgeRenderingFunction are in effect directly spliced into the graphic generated by a function like GraphPlot. Inset can be used to insert an arbitrary expression.
- EdgeRenderingFunction->Automatic renders edges according to the styles specified by DirectedEdges and EdgeLabeling.
- Settings for PlotStyle define defaults that can be overridden by explicit directives in EdgeRenderingFunction.
Examples
open all close allBasic Examples (3)
Draw edges as red arrows set back by a small amount:
LayeredGraphPlot[{1 -> 5, 2 -> 4, 3 -> 4, 3 -> 5, 4 -> 5}, EdgeRenderingFunction -> ({Red, Arrow[#1, 0.1]}&)]Draw edges as cylinders and vertices as spheres:
GraphPlot3D[{2 -> 3, 2 -> 4, 2 -> 5, 3 -> 4, 3 -> 5, 4 -> 5}, EdgeRenderingFunction -> (Cylinder[#1, 0.05]&), VertexRenderingFunction -> (Sphere[#, 0.1]&)]GraphPlot3D[Table[1, {100}, {100}], EdgeRenderingFunction -> None, VertexRenderingFunction -> (Sphere[#, 0.05]&)]Scope (2)
GraphPlot[{4 -> 1, 5 -> 1, 3 -> 2, 2 -> 5, 3 -> 4, 3 -> 5, 5 -> 4}, EdgeRenderingFunction -> ({Arrow[#], Inset["Mathematica", Mean[#1], Automatic, Automatic, #[[1]] - #[[2]], Background -> White]}&)]arrow = [image];GraphPlot[{2 -> 1, 3 -> 1, 4 -> 1, 5 -> 1, 6 -> 1}, EdgeRenderingFunction -> ({Line[#], Inset[arrow, Mean[#1], Automatic, Automatic, #[[2]] - #[[1]], Background -> White]}&)]Tech Notes
History
Text
Wolfram Research (2007), EdgeRenderingFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeRenderingFunction.html.
CMS
Wolfram Language. 2007. "EdgeRenderingFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EdgeRenderingFunction.html.
APA
Wolfram Language. (2007). EdgeRenderingFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeRenderingFunction.html
BibTeX
@misc{reference.wolfram_2026_edgerenderingfunction, author="Wolfram Research", title="{EdgeRenderingFunction}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeRenderingFunction.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_edgerenderingfunction, organization={Wolfram Research}, title={EdgeRenderingFunction}, year={2007}, url={https://reference.wolfram.com/language/ref/EdgeRenderingFunction.html}, note=[Accessed: 13-June-2026]}