rot_x: Rotate axis text

View source: R/utils.R

rot_xR Documentation

Rotate axis text

Description

Rotate axis text

Usage

rot_x(angle = 30, hjust = 1, vjust = NULL, vertical = FALSE, ...)

rot_y(angle = 30, hjust = 1, vjust = NULL, vertical = FALSE, ...)

Arguments

angle

passed to ggplot2::element_text().

hjust

passed to ggplot2::element_text().

vjust

passed to ggplot2::element_text().

vertical

if TRUE, then x-axis tick labels are rotated 90 degrees with vjust set to 0.5 and hjust set to 1; when using rot_y(), y-axis tick labels are rotated 90 degrees with hjust set to 0.5 with vjust set to 1; see details.

...

passed to ggplot2::element_text().

Details

If x-axis tick labels do not have enough space, consider using vertical = TRUE. By default, the tick labels will be justified up to the x-axis line. Use hjust = "bottom" (with vertical = TRUE) to justify the axis labels toward the bottom margin of the plot. Similar behavior can be made for y-axis tick labels, but use vertical = TRUE and set vjust to either "left" or "right" to control proximity to the y-axis.

Examples

data <- pmplots_data_obs()

dv_pred(data) + rot_x()

## Not run: 
cwres_cat(data, x = "CPc") + rot_x(vertical = TRUE)
cwres_cat(data, x = "CPc") + rot_x(vertical = TRUE, hjust = "bottom")

cwres_cat(data, x = "CPc") + rot_y(vertical = TRUE)
cwres_cat(data, x = "CPc") + rot_y(vertical = TRUE, vjust = "left")

## End(Not run)


metrumresearchgroup/pmplots documentation built on Oct. 15, 2024, noon