These function take a "Picture"
object and either draw the
picture or create a grid graphical object representing the picture.
pictureGrob(picture,
x = unit(0.5, "npc"), y = unit(0.5, "npc"),
width = NULL, height = NULL,
just = "centre", hjust = NULL, vjust = NULL,
default.units = "npc", expansion = 0.05,
xscale = NULL, yscale = NULL, distort = FALSE,
gpFUN = identity, ...,
ext = c("none", "clipbbox", "gridSVG"),
delayContent = match.arg(ext) == "gridSVG",
name = NULL, prefix = NULL, clip = "on")
grid.picture(...)
A grid gTree.
A "Picture"
object.
A single numeric value or unit object specifying an x-value.
A single numeric value or unit object specifying a y-value.
A single numeric value or unit object specifying a width.
May also be NULL
(see Details).
A single numeric value or unit object specifying a height.
May also be NULL
(see Details).
The justification of the picture relative to its (x, y) location.
If there are two values, the first value specifes horizontal
justification and the second value specifies vertical justification.
Possible string values are: "left"
, "right"
,
"centre"
, "center"
, "bottom"
, and "top"
.
For numeric values, 0 means left alignment and 1 means right
alignment.
A numeric vector specifying horizontal justification. If specified,
overrides the just
setting.
A numeric vector specifying vertical justification. If specified,
overrides the just
setting.
A string indicating the default units to use if x
, y
,
width
, or height
are only given as numeric vectors.
An expansion factor; determines whether any space is left between the extent of the picture and the bounding rectangle it is drawn within.
A numeric vector of length two indicating the minimum and maximum on the x-scale.
A numeric vector of length two indicating the minimum and maximum on the y-scale.
A logical value indicating whether the image should preserve its aspect ratio or distort to fit the area it is being drawn within.
A function that takes in a grid gpar
object and returns a
(optionally modified) gpar
object.
For grid.picture
, arguments to be passed to
pictureGrob
. For pictureGrob
, arguments to be passed
to the picture object's grobify
method.
A character vector. Selects from one of three possible extensions
for drawing imported pictures. "none"
means that no clipping
will be applied to the imported picture. "clipbbox"
means
that clipping will be applied, but only to the bounding boxes of any
imported clipping paths. "gridSVG"
means that gridSVG will be
used when drawing the "Picture"
object, which enables the use
of complex clipping paths, gradients, patterns, etc. to be rendered
from an imported picture.
If FALSE
, pictureGrob()
generates a gTree with
children immediately.
If TRUE
, pictureGrob()
produces a gTree with a
makeContent()
method so that children are generated only
at drawing time. The latter is relevant when ext ==
"gridSVG"
because it affects when SVG definitions are
registered.
A character identifier.
A character string. A prefix to add to referenced gridSVG content
(e.g. pattern fills). Only used when gridSVG
is TRUE
(for grobify
). The reference label must be a unique reference
label, otherwise an error will result. This can be checked by
calling gridSVG's listSVGDefinitions()
. When this parameter
is NULL
, a prefix will automatically be generated but this is
not guaranteed to be unique.
Clipping setting passed to the viewport that is set up for drawing the imported image.
Simon Potter
If width
or height
is NULL
, and
distort=FALSE
,
the aspect ratio of the image will be respected.
By default, the image will match the width/height of the current viewport,
(if distort=FALSE
, as much as the aspect ratio allows),
less any expansion
.
grobify
, grid.symbols
.