Closed IndrajeetPatil closed 2 years ago
I think this is intended given the axis.text = element_text(),
present in the fivethrityeight code. Other themes do not have the element blank as you mentioned, but some themes have axis tick marks blank, titling blank, and other stuff too. For instance, in economist.R you are unable to adjust the panel.border
due to the designer setting that blank.
I'm not sure if this is a bug; I think it's an intended feature to keep the themes close to their source (FiveThirtyEight notoriously rarely ever adds axis labels).
Also wanted to show that this isn't a dual-axis issue or an issue in how you've labeled the axis here, no titling functions work when using that theme for intended purposes:
library(ggplot2)
library(ggthemes)
p <- ggplot(mtcars, aes(cyl, mpg)) + geom_point()
# works
p +
theme_economist() +
labs(y = "test",
x = "test")
# works
p +
theme_gdocs() +
labs(y = "test",
x = "test")
# doesn't work
p +
theme_fivethirtyeight() +
labs(y = "test",
x = "test") +
xlab("test") + # These don't work either:
ylab("test")
I'm not sure if this is a bug; I think it's an intended feature to keep the themes close to their source (FiveThirtyEight notoriously rarely ever adds axis labels).
@KayleeDavisGitHub Thanks for the detailed explanation! Makes sense then that this doesn't work.
Happy to help @IndrajeetPatil ❤️ Thanks for all the work you've done for the R community!
For completeness here are some other resources if people are interested:
Created on 2022-04-16 by the reprex package (v2.0.1)