PatternFilling[obj]
is a two-dimensional graphics directive specifying that obj should be used to fill faces of polygons and other filled graphics objects.
PatternFilling["name"]
uses the specified pattern "name".
PatternFilling[obj,size]
specifies the size of the object obj.
PatternFilling[obj,size,{dx,dy}]
moves the object obj by the offset {dx,dy}.
PatternFilling
PatternFilling[obj]
is a two-dimensional graphics directive specifying that obj should be used to fill faces of polygons and other filled graphics objects.
PatternFilling["name"]
uses the specified pattern "name".
PatternFilling[obj,size]
specifies the size of the object obj.
PatternFilling[obj,size,{dx,dy}]
moves the object obj by the offset {dx,dy}.
Details
- PatternFilling is also known as rectangular tiling.
- PatternFilling is typically used to fill polygons and areas with repeated rectangular patterns.
- Possible patterns include:
- PatternFilling[{"name",style,color},…] specifies that faces of filled graphics objects are to be drawn using the predefined pattern "name" with the specified style and background color.
- In PatternFilling[obj,…], the object obj can be a 2D graphic or an image.
- With PatternFilling[obj,{w,h}], the object obj will always be drawn in a w×h region and will be sized to fit in the region.
- PatternFilling[obj,{w,h},{dx,dy}] moves obj by the absolute offset {dx,dy} in the whole w×h region.
- ImageScaled can be used to specify the size and is taken to be fractions of the default image size.
- PatternFilling[obj] is effectively equivalent to PatternFilling[obj,ImageScaled[.2]].
- PatternFilling[obj] is equivalent to PatternFilling[Rasterize[obj]] and will rasterize obj at the size and resolution it would normally be displayed in a notebook.
Examples
open all close allBasic Examples (3)
Apply a checkerboard pattern to a disk:
Graphics[{PatternFilling["Checkerboard"], Disk[]}]Plot[{Sin[x] + x / 2, Sin[x] + x}, {x, 0, 10}, Filling -> {1 -> {2}}, FillingStyle -> PatternFilling["Hexagon", ImageScaled[1 / 10]]]Show a map of the US with its flag:
GeoGraphics[{GeoStyling["OutlineMap", PatternFilling[[image], {85, 48}]], Polygon[["United States"]]}]Scope (13)
Basic Uses (6)
Apply pattern filling to graphics primitives:
Graphics[{PatternFilling[[image]], #}]& /@ {Rectangle[], Disk[], Annulus[]}Apply pattern filling to a plot:
Plot[2Sin[x] + x, {x, 0, 15}, Filling -> Bottom, FillingStyle -> PatternFilling[[image], ImageScaled[1 / 10]]]Apply pattern filling to a chart:
BarChart[{1, 2, 3, 4}, ChartStyle -> PatternFilling["Hexagon", ImageScaled[1 / 10]]]Region[Style[ImplicitRegion[y^2 < x (-1 + x^3), {x, y}], PatternFilling[[image], 10]]]GeoGraphics[{GeoStyling["OutlineMap", PatternFilling[[image], 10]], Polygon[["austria"]]}]PatternFilling[[image]]Specification (7)
PatternFilling works on 2D graphics:
g = Graphics[Circle[], PlotRangePadding -> 0];Graphics[{PatternFilling[g], EdgeForm[StandardGray], Rectangle[]}]PatternFilling using 2D images:
Graphics[{PatternFilling[[image]], Disk[]}]Graphics[{PatternFilling[#], Rectangle[]}]& /@ {"Checkerboard", "Chevron", "ChevronLine", "Circle", "Diamond", "DiamondBox", "DiamondPlate", "DiamondPoint", "Grain", "Grid", "GridPoint", "Halftone", "HalftoneGrid", "Herringbone", "Hexagon", "Octagon", "Plaid", "Weave", "XGrid", "XGridPoint"}Graphics[{PatternFilling[{"Checkerboard", Red}], Rectangle[]}]Graphics[{PatternFilling[{"Checkerboard", Red, StandardGray}], Rectangle[]}]Pattern sizes by a fraction of the whole image:
Graphics[{PatternFilling[[image], ImageScaled[1 / 5]], EdgeForm[StandardGray], Rectangle[]}]Graphics[{PatternFilling[[image], {50, 50}], EdgeForm[StandardGray], Rectangle[]}]Graphics[{PatternFilling[[image], ImageScaled[1 / 4], #], EdgeForm[StandardGray], Rectangle[]}] & /@ {{0, 0}, ImageScaled[{.25, 0}], ImageScaled[{.5, 0}], ImageScaled[{.75, 0}]}Applications (7)
Design Patterns (6)
motif = Image[{{0, 1}, {1, 0}}]Graphics[{PatternFilling[motif], Rectangle[]}]motif = Graphics[{Circle[{-1, 0}, 1, {Pi / 2, -Pi / 2}], Circle[{0, 0}, 1], Circle[{1, 0}, 1, {Pi / 2, 3Pi / 2}], Circle[{0, 1}, 1, {0, -Pi}], Circle[{0, -1}, 1, {0, Pi}], Circle[{-1, 1}, 1, {0, -Pi / 2}], Circle[{1, 1}, 1, {Pi, 3Pi / 2}], Circle[{-1, -1}, 1, {Pi / 2, 0}], Circle[{1, -1}, 1, {Pi, Pi / 2}]}, ImagePadding -> 0, PlotRangePadding -> 0]Graphics[{PatternFilling[motif], EdgeForm[StandardGray], Disk[]}]motif = Graphics[{Red, Line[{{-1., 1.}, {1., -1.}}], Line[{{-1., -1.}, {1., 1.}}],
Line[{{-1., 0.}, {0., 1.}, {1., 0.}, {0., -1.}, {-1., 0.}}],
Line[{{-0.5, 0.}, {0., 0.5}, {0.5, 0.}, {0., -0.5}, {-0.5, 0.}}], Line[{{-1., 0.5}, {-0.5, 1.}}],
Line[{{0.5, 1.}, {1., 0.5}}], Line[{{0.5, -1.}, {1., -0.5}}], Line[{{-1., -0.5}, {-0.5, -1.}}]}, ImagePadding -> 0, ImageSize -> 36, PlotRangePadding -> 0]Graphics[{PatternFilling[motif], EdgeForm[Red], Disk[]}]motif = Graphics[{HilbertCurve[4]}]Graphics[{PatternFilling[motif, ImageScaled[.5]], EdgeForm[StandardGray], Annulus[]}]motif = Graphics[Line[Table[{{k, -1}, {k + 1, 1}}, {k, -2, 2, .2}]], PlotRange -> 1]Plot[{Sin[x] + x / 2, Sin[x] + x}, {x, 0, 10}, Filling -> {1 -> {2}}, FillingStyle -> PatternFilling[motif]]motif = Graphics[{Line[{{-.1, -.1}, {1.1, 1.1}}], Line[{{-.1, 1.1}, {1.1, -.1}}]}, ImageSize -> 32, PlotRange -> {{0, 1}, {0, 1}}, PlotRangePadding -> None]Plot[Sin[x], {x, 0, 2Pi}, Filling -> Axis, FillingStyle -> PatternFilling[motif, ImageScaled[1 / 20]]]Transforming Patterns (1)
motif = [image];GeoGraphics[{GeoStyling["OutlineMap", EdgeForm[Black], PatternFilling[motif]], Polygon[["austria"]]}]image = RemoveBackground[motif, {"Background", White}];GeoGraphics[{GeoStyling["OutlineMap", EdgeForm[Black], PatternFilling[image]], Polygon[["austria"]]}]Related Guides
History
Text
Wolfram Research (2020), PatternFilling, Wolfram Language function, https://reference.wolfram.com/language/ref/PatternFilling.html.
CMS
Wolfram Language. 2020. "PatternFilling." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PatternFilling.html.
APA
Wolfram Language. (2020). PatternFilling. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PatternFilling.html
BibTeX
@misc{reference.wolfram_2026_patternfilling, author="Wolfram Research", title="{PatternFilling}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/PatternFilling.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_patternfilling, organization={Wolfram Research}, title={PatternFilling}, year={2020}, url={https://reference.wolfram.com/language/ref/PatternFilling.html}, note=[Accessed: 12-June-2026]}