is an option for graphics functions which gives a list of graphics primitives to be rendered before the main part of the graphics is rendered.
Prolog
is an option for graphics functions which gives a list of graphics primitives to be rendered before the main part of the graphics is rendered.
Details
- Graphics primitives specified by Prolog are rendered after axes, boxes, and frames are rendered.
- In three-dimensional graphics, two-dimensional graphics primitives can be specified by the Prolog option. The graphics primitives are rendered in a 0, 1 coordinate system.
- Directives specified by Prolog affect only the prolog, and not other contents of a graphic.
Examples
open all close allBasic Examples (2)
Draw a disk behind the plot of a quadratic function:
Plot[x^2, {x, -1.5, 1.5}, Prolog -> {Pink, Disk[{0, 1}, 1]}, PlotStyle -> Thick, AspectRatio -> Automatic]Draw a bar chart using rectangles behind ListLinePlot:
data = RandomReal[1, {10}];ListLinePlot[data, Prolog -> {Orange, MapIndexed[Rectangle[{First[#2] - .3, 0}, {First[#2] + .3, #1}]&, data]}, PlotStyle -> Thick]Scope (2)
The ordinary coordinate system is used for Prolog in 2D graphics:
Table[Graphics[{Pink, Opacity[.5], Disk[{0, 0}, 10]}, Axes -> True, Prolog -> Disk[p, 2]], {p, {{-7, -7}, {0, 0}, {7, 7}}}]A scaled 0, 1 coordinate system is used for Prolog in 3D graphics:
Table[Graphics3D[{Opacity[.5], Sphere[{0, 0, 0}, 10]}, Prolog -> Disk[p, .1]], {p, {{.2, .2}, {.5, .5}, {.8, .8}}}]Applications (1)
Define a simple graphic to use as a background:
bg = Polygon[{ImageScaled[{0, 0}], ImageScaled[{1, 0}], ImageScaled[{1, 1}], ImageScaled[{0, 1}]}, VertexColors -> {StandardBlue, StandardGreen, StandardYellow, StandardOrange}];Plot[Sin[x ^ 2], {x, 0, 5}, Prolog -> bg, PlotRangeClipping -> False]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, Prolog -> bg, Mesh -> None]Properties & Relations (1)
Related Guides
History
Introduced in 1991 (2.0)
Text
Wolfram Research (1991), Prolog, Wolfram Language function, https://reference.wolfram.com/language/ref/Prolog.html.
CMS
Wolfram Language. 1991. "Prolog." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Prolog.html.
APA
Wolfram Language. (1991). Prolog. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Prolog.html
BibTeX
@misc{reference.wolfram_2026_prolog, author="Wolfram Research", title="{Prolog}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/Prolog.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_prolog, organization={Wolfram Research}, title={Prolog}, year={1991}, url={https://reference.wolfram.com/language/ref/Prolog.html}, note=[Accessed: 13-June-2026]}