You can modify the alignment of inset grobs with the vjust
and hjust
aesthetics. These can either be a number between 0
(right/bottom) and 1 (top/left) or a character ("left", "middle", "right",
"bottom", "center", "top").
You can modify the size of inset grobs with the vp.width
and
vp.height
aesthetics. These can take a number between 0 (smallest
possible inset) and 1 (whole plotting area width or height). The default
value for for both of these aesthetics is 1/5. Thus, in contrast to
geom_text
and geom_text_s
the size of
the insets remains the same relative to the size of the plotting area
irrespective of how the plot is rendered. The aspect ratio of insets is
preserved and size is adjusted until the whole inset fits within the
viewport.
You can modify inset grob alignment with the `vjust` and `hjust`
aesthetics. These can either be a number between 0 (right/bottom) and 1
(top/left) or a character (`"left"`, `"middle"`, `"right"`, `"bottom"`,
`"center"`, `"top"`). There several two special alignments: `"inward"` and
`"outward"`. Inward always aligns text towards the center of the plotting
area, and outward aligns it away from the center of the plotting area. It
tagged with `_mean` or `_median` the mean or median of the data in the
panel along the corresponding axis is used as center.
By default this geom uses position_nudge_center
which is
backwards compatible with position_nudge
but
provides additional control on the direction of the nudging. In contrast to
position_nudge
, position_nudge_center
and all other position functions defined in packages 'ggpp' and 'ggrepel'
keep the original coordinates thus allowing the plotting of connecting
segments and arrows.
This geom works only with tibbles as data
, as its expects a list of
graphics objects ("grob") to be mapped to the label
aesthetic.
The x
and y
aesthetics determine the position of the whole
inset grob, similarly to that of a text label, justification is interpreted
as indicating the position of the grob with respect to its $x$ and $y$
coordinates in the data, and angle
is used to rotate the grob as a
whole.
In the case of geom_grob_npc()
, npcx
and npcy
aesthetics determine the position of the inset grob. As for text labels,
justification is interpreted as indicating the position of the grob with
respect to the x and y coordinates in "npc" units, and angle
is used
to rotate the plot as a whole.
annotate
cannot be used with geom = "grob"
.
Use annotate
(automatic unless 'ggpp' is not attached) as
redefined in 'ggpp' when adding inset grobs as annotations (automatic
unless 'ggpp' is not attached).