Axis guide with ticks for minor breaksSource:
These are similar the the normal axis guides for position scales, but also place tickmarks at minor break positions.
A character string or expression indicating a title of guide. If
NULL, the title is not shown. By default (
waiver()), the name of the scale object or the name specified in
labs()is used for the title.
silently remove overlapping labels, (recursively) prioritizing the first, last, and middle labels.
Compared to setting the angle in
element_text(), this also uses some heuristics to automatically pick the
vjustthat 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.
- colour, color
character(1)with a valid colour for colouring the axis text, axis ticks and axis line. Overrules the colour assigned by the theme.
- trunc_lower, trunc_upper
The lower and upper range of the truncated axis:
NULLto not perform any truncation.
functionthat 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
numericvalue in data units for the lower and upper boundaries.
Where this guide should be drawn: one of top, bottom, left, or right.
This axis guide uses the following the theme elements:
rel()object to set the size of minor ticks relative to the length of major ticks (
axis.ticks.length). Defaults to
# 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))