Skip to content

Instantly share code, notes, and snippets.

@jrnold
Last active June 7, 2021 15:19
Show Gist options
  • Select an option

  • Save jrnold/79d76e927386298688c9 to your computer and use it in GitHub Desktop.

Select an option

Save jrnold/79d76e927386298688c9 to your computer and use it in GitHub Desktop.
Changing axis title and text size in ggplot with theme_economist
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
colour=factor(gear))) +
facet_wrap(~am)
# Change the size of axis titles to be 2 x that of the default text size using function rel
# Change the size of the axis text to be 8 pt
p + theme_economist() + scale_colour_economist() +
theme(axis.title = element_text(size = rel(2)),
axis.text = element_text(size = 8)
@morosophist

Copy link
Copy Markdown

Final line missing a closing ')'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment