pattern(grob, x = unit(0, "npc"), y = unit(0, "npc"), width = unit(0.1, "npc"), height = unit(0.1, "npc"), default.units = "npc", just = "centre", hjust = NULL, vjust = NULL, dev.width = 7, dev.height = 7)
registerPatternFill(label, pattern = NULL, ...)
registerPatternFillRef(label, refLabel, pattern = NULL, ...)
registerPatternFill
.
pattern
object created by pattern
.
"left"
, "right"
,
"centre"
, "center"
, "bottom"
, and "top"
.
For numeric values, 0 means left alignment and 1 means right
alignment.
just
setting.
just
setting.
x
, y
,
width
, or height
are only given as numeric vectors.
7
.
pattern
.
pattern
object for pattern
, none otherwise.
dev.width
and dev.height
. The
grob
and vp
that have been given are then drawn within
this device. This is relevant for determining what the pattern
definition looks like. The previous arguments do not determine the size of the pattern as it
is being used (i.e. how big each "tile" is). This is set by the
x
, y
, width
, height
arguments. The values
of these arguments are relative to the current viewport as this
function is being called. From then on, the definition of the location
and size of the pattern are fixed.
In summary, the pattern
function defines what a pattern
looks like, along with how big each tile is (and its position).
To avoid repetition of pattern definitions, use
registerPatternFillRef
to reuse an existing pattern definition
(referred to by refLabel
). This means that a pattern "tile" can
now be reused, repositioned and rescaled without having to describe
how it needs to be drawn.
In general use, first create a pattern object, then either give a
label to the definition (for grobs to use), or alternatively simply
pass on the pattern object to grid.patternFill
.
grid.patternFill