ggtikzAnnotation {ggtikz} | R Documentation |
Prepare a TikZ annotation for a ggplot.
Description
ggtikzAnnotation objects are meant to be added to a ggtikzCanvas object.
Usage
ggtikzAnnotation(
tikz_code,
x = c("data", "panel"),
y = c("data", "panel"),
xy = NULL,
panelx = NULL,
panely = NULL,
transform = TRUE,
replace_inf = TRUE,
clip = "on"
)
Arguments
tikz_code |
The tikz code to use for annotation. Backslashes must be escaped! |
x |
Reference frame for the x coordinates. Either "data" or "panel". |
y |
Reference frame for the y coordinates. Either "data" or "panel". |
xy |
Reference frame for both x and y coordinates. Trumps |
panelx |
x position of the panel to use as coordinate reference, starting from the left, 1-based. |
panely |
y position of the panel to use as coordinate reference, starting from the top, 1-based. |
transform |
Should TikZ coordinates be transformed according to the
scale transformation? If |
replace_inf |
Should annotation coordinates containing 'Inf' or '-Inf'
be adjusted so these values correspond to the edge of the available space?
This is analogous to the behavior of ggplot when infinite values are
encountered.
See also |
clip |
Should annotations be clipped to the panel boundaries?
See the |
Details
This function prepares TikZ annotations in a form understandable to a ggtikzCanvas object. An annotation can be added to multiple ggtikzCanvas objects, provided that each underlying ggplot object has the necessary panels to know what to do with this information.
Value
A ggtikzAnnotation object, which can be added to a ggtikzCanvas object.
See Also
grid.tikzAnnotate
for annotation of base graphics
ggtikz
for a helper function for quick one-step annotations.
ggtikzCanvas
for information about initiating the annotation process.