Is there a way to rotate the x-axis labels in a ggplot plot AND change the theme at the same time?
If I do this, I can rotate the x-axis labels:
ToothGrowth$dose <- as.factor(ToothGrowth$dose)ggplot(ToothGrowth, aes(x=dose, y=len)) + geom_boxplot() + theme(axis.text.x = element_text(angle = 90, hjust = 1))
But if I add a theme, the rotations won't work:
ToothGrowth$dose <- as.factor(ToothGrowth$dose)ggplot(ToothGrowth, aes(x=dose, y=len)) + geom_boxplot() + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + theme_minimal()
I tried adding the rotation within the theme_minimal()
function, but that didn't work either.
Thanks.