Description Usage Arguments Building upon 'theme_ewen' Examples
[ggplot2] theme supporting the ewen.io site, based on 'theme_ipsum' from hrbrthemes.
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 28 29 30 31 32 33 34 | theme_ewen(
base_family = "Arial Narrow",
base_colour = "#111111",
base_size = 14,
base_margin = 10,
base_face = "plain",
plot_title_family = "Arial Narrow",
plot_title_size = 24,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = base_family,
subtitle_size = base_size,
subtitle_face = base_face,
subtitle_margin = base_margin,
axis_text_family = base_family,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = base_size,
axis_title_face = base_face,
axis_title_margin = base_margin,
axis_title_just = "rt",
caption_family = base_family,
caption_size = base_size,
caption_face = base_face,
caption_margin = base_margin,
strip_text_family = base_family,
strip_text_size = base_size,
strip_text_face = base_face,
plot_margin = c(10, 10, 10, 10),
grid_col = "#cccccc",
grid = "Y",
axis_col = "#9B9B9B",
axis = "x"
)
|
base_family, base_colour, base_size, base_margin, base_face |
base font family, colour, size, margin and face |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin |
plot title family, face, size and margi |
subtitle_family, subtitle_face, subtitle_size |
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
axis_text_family, axis_text_size |
axis text font family and size |
axis_title_family, axis_title_face, axis_title_size, axis_title_margin |
axis title font family, face, size and margin |
axis_title_just |
axis title font justification, one of '[blmcrt]' |
caption_family, caption_face, caption_size, caption_margin |
plot caption family, face, size and margin |
strip_text_family, strip_text_face, strip_text_size |
facet label font family, face and size |
plot_margin |
plot margin (specify with [ggplot2::margin()]) |
grid_col, axis_col |
grid & axis colors; grid defaults to '#cccccc', axes default to '#2b2b2b' |
grid |
panel grid ('TRUE', 'FALSE', or a combination of 'X', 'x', 'Y', 'y') |
axis |
add x or y axes? 'TRUE', 'FALSE', "'xy'" |
The function is setup in such a way that you can customize your own one by just wrapping the call and changing the parameters. See source for examples.
There is an option 'ewenthemes.loadfonts' which – if set to 'TRUE' – will call 'extrafont::loadfonts()' to register non-core fonts with R PDF & PostScript devices. If you are running under Windows, the package calls the same function to register non-core fonts with the Windows graphics device.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
library(ggplot2)
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
labs(x="Fuel efficiency (mpg)", y="Weight (tons)",
title="Seminal ggplot2 scatterplot example",
subtitle="A plot that is only useful for demonstration purposes",
caption="Brought to you by the letter 'g'") +
theme_ewen()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.