You can see examples in this page.
Notice that in theme_wsj example, xlab and ylab do not appear.
Here's a non-ggthemes plot that includes labels:
ggplot(mtcars, aes(factor(cyl), mpg)) +
geom_point() +
xlab("Hello World: X axis") +
ylab("Hello World: Y axis")
But, when you add the theme_wsj theme, they disappear:
ggplot(mtcars, aes(factor(cyl), mpg)) +
geom_point() +
xlab("Hello World: X axis") +
ylab("Hello World: Y axis") +
theme_wsj()
If you look on source code of theme_wsj() you can see that axis titles are set as blank
theme_wsj<-function(base_size=12, color="brown", base_family="sans", title_family="Courier") {
colorhex <- ggthemes_data$wsj$bg[color]
(theme_foundation()
+ theme(
.....
axis.title=element_blank()
....
So one solution to get xlab and ylab to be shown is to add new theme element
+theme_wsj()+theme(axis.title=element_text(size=12))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With