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 allclose all

Basic Examples  (3)

Apply a checkerboard pattern to a disk:

Fill between two curves:

Show a map of the US with its flag:

Scope  (13)

Basic Uses  (6)

Apply pattern filling to graphics primitives:

Apply pattern filling to a plot:

Apply pattern filling to a chart:

Style a geometric region:

Show a schematic outline map:

Summary box:

Specification  (7)

PatternFilling works on 2D graphics:

PatternFilling using 2D images:

Predefined patterns:

Style a predefined pattern:

Add a background:

Pattern sizes by a fraction of the whole image:

Patterns with absolute sizes:

Offset patterns:

Applications  (7)

Design Patterns  (6)

A checkerboard pattern:

Filling a rectangle:

A circle pattern:

Filling a regular polygon:

A diamond pattern:

Filling a regular polygon:

A space-filling curve:

Filling an annulus:

A hatch pattern:

Fill between two curves:

A crosshatch pattern:

Fill to the axis:

Transforming Patterns  (1)

Show a map with a motif:

Use a transparent background:

Wolfram Research (2020), PatternFilling, Wolfram Language function, https://reference.wolfram.com/language/ref/PatternFilling.html.

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_2024_patternfilling, author="Wolfram Research", title="{PatternFilling}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/PatternFilling.html}", note=[Accessed: 23-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_patternfilling, organization={Wolfram Research}, title={PatternFilling}, year={2020}, url={https://reference.wolfram.com/language/ref/PatternFilling.html}, note=[Accessed: 23-November-2024 ]}