Description Usage Format Examples
A ggplot2 theme object to make creating plots and visualisations simpler and easier. Just add "+ dk_theme" when building your plot layers.
1 |
A list with a ggplot2 object data.
ggplot2 theme object
modifies the default colours to datakind palette
modifies the default fill colours to datakind palette
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
ggplot2::ggplot(data.frame( y = runif(100, min = 0, max = 20) +
seq(1, 100, 1),
x = seq(1, 100, 1),
z = rep_len(c("a", "b", "c", "d"), 100)),
ggplot2::aes(x, y, colour = z, fill = z)) +
ggplot2::geom_point() +
ggplot2::facet_wrap(~z, nrow = 2) +
ggplot2::geom_smooth(se = TRUE) +
ggplot2::labs(title = "Some Data (2011)",
x = "Range", y = "Value") +
dk_theme +
ggplot2::scale_fill_manual(values = dk_sequential_palette)
ggplot2::ggplot(data.frame( x = c('Primary 1', 'Primary 2',
'Secondary 1', 'Secondary 2'),
y = runif(4, 10, 100)),
ggplot2::aes(x,y, fill = x)) +
ggplot2::geom_bar(stat = "identity") +
ggplot2::labs(title = "Some Data (2011)",
x = "Range", y = "Value") +
dk_theme
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.