Description Usage Details Examples
Rotates and repositions the y-axis title where short titles allow for them to be positioned horizontally at the top of the y-axis (without causing excessive whitespace on left of plot).
1 |
This function just sets the angle and justification of the y-axis title, orienting text horizontally above the y-axis as per GSS best practise. Depending on the placement of tick labels, you may need to expand the y-axis to accomodate tick labels and title, e.g. also run ggplot2::scale_y_continuous(expand = expansion(mult = c(0,.1)))
1 2 3 4 5 6 7 8 9 | library(ggplot2)
ggplot(iris, aes(x = Species, y = Sepal.Length)) +
geom_boxplot(fill = wwfc_cols("light gold 20")) +
wolves_theme(media = "web") +
labs(title = "Virginica sepals are longest",
subtitle = "Sepal length by species",
y = "/mm") +
scale_y_continuous(expand = expansion(mult = c(0.1, 0.1))) +
flip_y_title()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.