Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppression of axis labels #66

Closed
geotheory opened this issue Jul 2, 2016 · 1 comment
Closed

Suppression of axis labels #66

geotheory opened this issue Jul 2, 2016 · 1 comment

Comments

@geotheory
Copy link

Thanks for these super neat themes. Small suggestion:

p = ggplot(iris, aes(Sepal.Width, Sepal.Length)) + geom_point(); p
p + theme_fivethirtyeight() + labs(x = 'Width', h = 'Length')
p + theme_wsj() + labs(x = 'Width', h = 'Length')

Is it possible to re-enable axis labels if they're specified?

@jrnold
Copy link
Owner

jrnold commented Jul 2, 2016

Yes. Since the ggplot2 themes are extensible, you can think of them as starting points rather than end points. Add + theme(...) to the ggplot object to adjust whatever you'd like. See the ggplot2 docs on this for a much deeper explanation. In your case, here's how to add back axis titles,

library("ggplot2")
library("ggthemes")


p <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) + geom_point(); p
p + theme_fivethirtyeight() + theme(axis.title = element_text()) + labs(x = 'Width', h = 'Length')
p + theme_wsj() + theme(axis.title = element_text()) +  labs(x = 'Width', h = 'Length') 

@jrnold jrnold closed this as completed Jul 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants