Description Usage Arguments Value Author(s) Examples
theme_nothing simply strips all thematic element in ggplot2.
1 | theme_nothing(base_size = 12, legend = FALSE)
|
base_size |
base size, not used. |
legend |
should the legend be included? |
a ggplot2 theme (i.e., a list of class options).
David Kahle david.kahle@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # no legend example
n <- 50
df <- expand.grid(x = 1:n,y = 1:n)[sample(n^2,.5*n^2),]
p <- qplot(x, y, data = df, geom = 'tile')
p
p + theme_nothing()
p + theme_nothing(legend = TRUE) # no difference
p +
scale_x_continuous(expand = c(0,0)) +
scale_y_continuous(expand = c(0,0)) +
theme_nothing()
# legend example
df$class <- factor(sample(0:1, .5*n^2, replace = TRUE))
p <- qplot(x, y, data = df, geom = "tile", fill = class)
p
p + theme_nothing()
p + theme_nothing(legend = TRUE)
p <- p +
scale_x_continuous(expand = c(0,0)) +
scale_y_continuous(expand = c(0,0))
p
p + theme_nothing()
p + theme_nothing(legend = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.