theme2: an enhanced version of ggplot2::theme()

Description Usage Arguments Examples

Description

theme2() has an enhanced version of ggplot2::theme() in terms of: 1. no element_(text|line|rect|grob|blank) specification 2. partial match for each configuration (e.g. size by sz)

Usage

1
theme2(..., as_string = FALSE)

Arguments

...

theme element specification (see examples below)

as_string

return the built theme function call as string. Default is FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

# all of the following three generate the same plot

ggplot(mtcars) + geom_point(aes(wt, hp, color=cyl)) +
   theme(text = element_text(size=20, face="bold"),
   axis.line = element_line(size=2),
   legend.key = element_rect(color="black"))

ggplot(mtcars) + geom_point(aes(wt, hp, color=cyl)) +
   theme2(text(size=20, face="bold"), axis.line(size=2),
          legend.key(color="black"))

ggplot(mtcars) + geom_point(aes(wt, hp, color=cyl)) +
   theme2(text(sz=20, f="bold"), axis.line(sz=2),
          legend.key(c="black"))



## End(Not run)

caprice-j/ggbash documentation built on May 13, 2019, 12:11 p.m.