ggplot2.labs.multiLines: add multi-lines xlab and ylab

Description Usage Arguments Value Examples

View source: R/ggplot_tools.R

Description

add multi-lines xlab and ylab

Usage

1
2
3
4
5
6
7
ggplot2.labs.multiLines(
  g,
  x.labs = NULL,
  y.labs = NULL,
  fontsize = 7,
  padding = 0.4
)

Arguments

g

a ggplot object

x.labs

a vector or list of title for x axis

y.labs

a vector or list of title for y axis

fontsize

fontsize for both x and y axes

Value

An arrangeGrob object

Examples

1
2
3
4
5
6
g <- ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width,color=Species))+
geom_point()
ggplot2.labs.multiLines(g,x.labs = list("Sepal Length","unit"),
                        fontsize = 7,padding =0.3) %>%
Taotao::preview.ggplot(width = 10,height = 7)
 @export

taotaochen86/myfuns documentation built on Jan. 23, 2021, 10:46 p.m.