Solutions: https://www.paulamoraga.com/book-r/99-problems-ggplot2-theme-solutions.html
Dataset diamonds {diamonds}
contains prices and other
attributes of almost 54000 diamonds
Remove Axis Labels
<- diamonds[sample(1:nrow(diamonds), size = 1000),]
df
ggplot(df, aes(carat, price, color = cut)) +
geom_point() +
theme(axis.text = element_blank())
Vertical Text Orientation
<- paste("Vertical Label", c(1, 2, 3, 4, 5))
lab
<- data.frame(x = sample(lab, size = 1000, replace = T),
ds y = sample(LETTERS[1:5], size = 1000, replace = T))
ggplot(ds, aes(x = x, fill = y)) +
geom_bar() +
theme(axis.text.x = element_text(angle = 90)) +
ggtitle("Vertical Axis Labels")
Angled Text Orientation