Description Usage Arguments Examples
A consistent ggplot theme for use by The Data Collective
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | theme_clean(
base_family = "Roboto Condensed",
base_size = 12,
base_colour = "#1C1C1C",
plot_title_family = base_family,
plot_title_size = base_size * 2.5,
plot_title_colour = base_colour,
subtitle_family = "Roboto Thin",
subtitle_size = base_size,
subtiitle_colour = base_colour,
title_family = base_family,
title_size = base_size * 1.2,
title_colour = base_colour,
caption_family = subtitle_family,
caption_size = base_size * 0.8,
caption_colour = base_colour,
panel_spacing = 25,
grid_y = 1,
grid_x = 1,
grid_colour = "#ECECEC"
)
|
base_family, base_size, base_colour |
base font family, size and colour |
plot_title_family, plot_title_size, plot_title_colour |
plot title font family, size and colour |
subtitle_family, subtitle_size, subtitle_colour |
subtitle font family size, and colour |
title_family, title_size, title_colour |
title font family, size and colour |
caption_family, caption_size, caption_colour |
caption font family, size and colour |
panel_spacing |
the gap between panels in points |
grid_y, grid_x |
the linestyle numeric 0-8 for the x/y gridlines |
grid_colour |
the colour of the grid lines |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
library(ggplot2)
library(dplyr)
# example scatterplot
ggplot(iris, aes(Sepal.Length, Petal.Length, colour = as.factor(Species))) +
geom_hline(yintercept = 0, colour = "#344055", size = 0.5) +
geom_point() +
labs(title = "Fisher's *Iris* data set",
subtitle = "Demonstrating the TDC theme for ggplot2",
x = "The x axis", y = "The y axis",
caption = "Fisher's **Iris** data set") +
facet_wrap(~ Species) +
theme_clean()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.