({{, (RefLink[PlotRangePadding, paclet:ref/PlotRangePadding])
is an option for graphics functions that specifies how much further axes etc. should extend beyond the range of coordinates specified by (RefLink[PlotRange, paclet:ref/PlotRange]). }})

OpenersNotesSection(Spacer1)Details

(RefLink[PlotRangePadding, paclet:ref/PlotRangePadding]) can be used for both two- and three-dimensional graphics.

The settings can be of the following forms:

For each direction the following forms can be used:

If (RefLink[PlotRange, paclet:ref/PlotRange]) includes all points in a plot, then (RefLink[PlotRangePadding, paclet:ref/PlotRangePadding])->(RefLink[Scaled, paclet:ref/Scaled])[s] yields a plot that covers a fraction 1-2s of the whole plotting area.

(RefLink[PlotRangePadding, paclet:ref/PlotRangePadding])->(RefLink[Automatic, paclet:ref/Automatic]) adds a total of 4% for (RefLink[PlotRange, paclet:ref/PlotRange]) settings (RefLink[All, paclet:ref/All]), (RefLink[Full, paclet:ref/Full]), and (RefLink[Automatic, paclet:ref/Automatic]). For explicit settings, it adds no padding.

Any padding specified by (RefLink[ImagePadding, paclet:ref/ImagePadding]) is added outside padding specified by (RefLink[PlotRangePadding, paclet:ref/PlotRangePadding]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

By default, 2% of padding is added to the plot range in each direction:

Graphics[{Pink,Rectangle[]},Frame->True]

Graphics3D[Cuboid[]]

No padding added:

Graphics[{Pink,Rectangle[]},PlotRangePadding->None,Frame->True]

Graphics3D[Cuboid[],PlotRangePadding->None]

Include 1 coordinate unit of padding on all sides:

Graphics[{Pink,Rectangle[]},PlotRangePadding->1,Frame->True]

Graphics3D[Cuboid[],PlotRangePadding->1]

OpenersExampleSection1(Spacer1)Scope  (2)

Pad on all sides by (1/10) the size of the image:

Graphics[{Pink,Rectangle[]},PlotRangePadding->Scaled[0.1],Frame->True]

Graphics3D[Cuboid[],PlotRangePadding->Scaled[0.1]]

Specify different padding on each side:

Graphics[{Pink,Rectangle[]},Frame->True,PlotRangePadding->{{0.5,1},{0.3,0.3}}]

Graphics3D[Cuboid[],PlotRangePadding->{{0.5,1},{0.3,0.3}}]

OpenersExampleSection2(Spacer1)Applications  (1)

Add padding to make the range of data more obvious:

ListPlot[RandomReal[{-1,1},50],PlotRangePadding->1]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

No padding is added if the plot range is explicit:

Graphics[{Pink,Rectangle[]},PlotRange->{{0,1},{0,1}},Frame->True]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[PlotRange, paclet:ref/PlotRange])  ▪  (RefLink[ImagePadding, paclet:ref/ImagePadding])  ▪  (RefLink[ImageMargins, paclet:ref/ImageMargins])  ▪  (RefLink[PlotRangeClipping, paclet:ref/PlotRangeClipping])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Options for Graphics, paclet:tutorial/Options])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Plotting and Image Regions, paclet:guide/PlottingAndImageRegions])}, {▪(RefLinkPlain[Graphics Shape & Size, paclet:guide/GraphicsShapeAndSize])}, {▪(RefLinkPlain[Graphics Coordinates, paclet:guide/GraphicsCoordinates])}})}})