Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rotate_axis_text

Rotate Axes Text


Description

Rotate the x-axis text (tick mark labels).

  • rotate_x_text(): Rotate x axis text.

  • rotate_y_text(): Rotate y axis text.

Usage

rotate_x_text(angle = 90, hjust = NULL, vjust = NULL, ...)

rotate_y_text(angle = 90, hjust = NULL, vjust = NULL, ...)

Arguments

angle

numeric value specifying the rotation angle. Default is 90 for vertical x-axis text.

hjust

horizontal justification (in [0, 1]).

vjust

vertical justification (in [0, 1]).

...

other arguments to pass to the function element_text().

Examples

# Load data
data("ToothGrowth")
df <- ToothGrowth

# Basic plot
p <- ggboxplot(df, x = "dose", y = "len")
p
# Vertical x axis text
p + rotate_x_text()
# Set rotation angle to 45
p + rotate_x_text(45)
p + rotate_y_text(45)

ggpubr

'ggplot2' Based Publication Ready Plots

v0.4.0
GPL-2
Authors
Alboukadel Kassambara [aut, cre]
Initial release
2020-06-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.