({{, (RefLink[Prolog, paclet:ref/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. }})

OpenersNotesSection(Spacer1)Details

Graphics primitives specified by (RefLink[Prolog, paclet:ref/Prolog]) are rendered after axes, boxes, and frames are rendered.

In three-dimensional graphics, two-dimensional graphics primitives can be specified by the (RefLink[Prolog, paclet:ref/Prolog]) option. The graphics primitives are rendered in a 0, 1 coordinate system.

Directives specified by (RefLink[Prolog, paclet:ref/Prolog]) affect only the prolog, and not other contents of a graphic.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic 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 (RefLink[ListLinePlot, paclet:ref/ListLinePlot]):

data=RandomReal[1,{10}];

ListLinePlot[data,Prolog->{Orange,MapIndexed[Rectangle[{First[#2]-.3,0},{First[#2]+.3,#1}]&,data]},PlotStyle->Thick]

OpenersExampleSection1(Spacer1)Scope  (2)

The ordinary coordinate system is used for (RefLink[Prolog, paclet:ref/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 (RefLink[Prolog, paclet:ref/Prolog]) in 3D graphics:

Table[Graphics3D[{Opacity[.5],Sphere[{0,0,0},10]},Prolog->Disk[p,.1]],{p,{{.2,.2},{.5,.5},{.8,.8}}}]

OpenersExampleSection2(Spacer1)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->{LightBlue,LightGreen,LightYellow,LightRed}];

Use it in multiple graphics:

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]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

Objects in (RefLink[Prolog, paclet:ref/Prolog]) are not included during (RefLink[PlotRange, paclet:ref/PlotRange]) computation:

Graphics[{Pink,Disk[]},Prolog->Circle[{0,1}],Frame->True]

OpenersExampleSection4(Spacer1)Neat Examples  (1)

Use a raster as a wallpaper:

r=Raster[Table[i,{i,100},{j,100}],{Scaled[{0,0}],Scaled[{1,1}]},{1,100},ColorFunction->"Pastel"];

Plot[{Sin[x],Cos[x],Csc[x]},{x,0,10},Prolog->r,PlotStyle->Thick]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Background, paclet:ref/Background])  ▪  (RefLink[Epilog, paclet:ref/Epilog])  ▪  (RefLink[BaseStyle, paclet:ref/BaseStyle])  ▪  (RefLink[FrameStyle, paclet:ref/FrameStyle])  ▪  (RefLink[AxesStyle, paclet:ref/AxesStyle])  ▪  (RefLink[PlotStyle, paclet:ref/PlotStyle])  ▪  (RefLink[DisplayFunction, paclet:ref/DisplayFunction])  ▪  (RefLink[Overlay, paclet:ref/Overlay])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Combining Graphics, paclet:guide/CombiningGraphics])}, {▪(RefLinkPlain[Graphics Annotation & Appearance, paclet:guide/GraphicsAnnotationAndAppearance])}})}})