These are similar the the normal axis guides for position scales, but also place tickmarks at minor break positions.
guide_axis_minor(
title = waiver(),
check.overlap = FALSE,
angle = NULL,
n.dodge = 1,
order = 0,
trunc_lower = NULL,
trunc_upper = NULL,
position = waiver()
)
silently remove overlapping labels, (recursively) prioritizing the first, last, and middle labels.
Compared to setting the angle in theme()
/ element_text()
,
this also uses some heuristics to automatically pick the hjust
and vjust
that
you probably want.
The number of rows (for vertical axes) or columns (for horizontal axes) that should be used to render the labels. This is useful for displaying labels that would otherwise overlap.
Used to determine the order of the guides (left-to-right, top-to-bottom), if more than one guide must be drawn at the same location.
The lower and upper range of the truncated axis:
NULL
to not perform any truncation.
A function
that takes the break positions as input and returns the lower
or upper boundary. Note that also for discrete scales, positions are the
mapped positions as numeric
.
A numeric
value in data units for the lower and upper boundaries.
A unit
object.
The lower and upper range of the truncated axis:
NULL
to not perform any truncation.
A function
that takes the break positions as input and returns the lower
or upper boundary. Note that also for discrete scales, positions are the
mapped positions as numeric
.
A numeric
value in data units for the lower and upper boundaries.
A unit
object.
Where this guide should be drawn: one of top, bottom, left, or right.
An axis_minor guide class object.
The length of minor ticks can be controlled relative to the length
of major ticks by setting ggh4x.axis.ticks.length.minor
as a
rel
object.
Other axis-guides:
guide_axis_logticks()
,
guide_axis_nested()
,
guide_axis_truncated()
# NOT RUN {
# Using the minor breaks axis
p <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
geom_point()
p + scale_y_continuous(guide = "axis_minor")
# Minor break positions are still controlled by the scale
p + scale_y_continuous(guide = "axis_minor",
minor_breaks = seq(4, 8, by = 0.2))
# Minor tick length is controlled relative to major ticks
p + scale_y_continuous(guide = "axis_minor") +
theme(ggh4x.axis.ticks.length.minor = rel(0.1))
# }
Run the code above in your browser using DataLab