custom_xlabs: Shortcut to customize a ggplot's x-axis labels

Description Usage Arguments Author(s) Examples

View source: R/custom_xlabs.R

Description

A wrapper for theme(axis.text.x = element_text(angle = 90, vjust = 0.5, ...)).

Usage

1
custom_xlabs(angle = 90, vjust = 0.5, ...)

Arguments

angle

Angle of rotation (in degrees). Defaults to 90.

vjust

Vertical justification (in [0,1]). Defaults to 0.5.

...

Other arguments to pass to element_text.

Author(s)

Jonah Gabry <jsg2201@columbia.edu>. See ggplot for the author of the ggplot function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
keep.vars <- c("year", "n.confinan", "fulltime")
plot.dat <- meltMyTS(by.year.ts, "year", keep.vars)
 # Rotate 90 degrees with vertical justification of 0.5 (the defaults)
ggMyTS(plot.dat, "n.confinan") + custom_xlabs()
 # Can also specify values
ggMyTS(plot.dat, "n.confinan") + custom_xlabs(angle = 65)
 # and additional arguments
my_xlabs <- custom_xlabs(angle = 65, color = "blue", face = "bold", family = "serif")
ggMyTS(plot.dat, "n.confinan") + my_xlabs


## End(Not run)

jgabry/QMSS_package documentation built on May 19, 2019, 7:18 a.m.