Secondary axis for providing space for text annotations
Source:R/sec-axis-spacer.R
sec_axis_spacer.RdA convenience wrapper around sec_axis_text() that reserves vertical (or
horizontal) space above (or beside) an axis without drawing visible text.
Useful for pushing axis titles away from the panel to make room for
annotations added with axis_text(), axis_ticks(), or axis_bracket().
Usage
sec_axis_spacer(
breaks = function(x) mean(x),
labels = "",
name = NULL,
guide = guide_sec_axis_spacer(),
...
)Arguments
- breaks
A function or numeric vector giving the break position(s) used to anchor the text. Defaults to
NULL, which places a single label at the midpoint of the scale — the mean of the limits for continuous scales.- labels
A character string used as the spacer. Defaults to
"". Use repeated newlines (e.g."\n") or a word to fit.- name
The name of the secondary axis. Use
ggplot2::waiver()to derive the name from the primary axis, orNULL(default) for no name.- guide
A guide object used to render the axis. Defaults to
guide_sec_axis_spacer(), which makes transparent ticks and lines.- ...
Additional arguments passed to
ggplot2::dup_axis().
Value
A ggplot2::sec_axis() object.