Change Size of All Text
+ theme(text=element_text(size=21))
Reorder Elements in an Axis by Some Column
aes(x = reorder(x1, ordercolumn))
Reorder Elements in an Axis Manually
ggplot(d, aes(x = factor(Emotion, level = c("Negative", "Neutral", "Positive"))
Center the Main Title
+ theme(plot.title = element_text(hjust = 0.5))
Remove Legend
+ theme(legend.position = "none")
Combine Multiple Plots
library(ggpubr)
manyplots <- ggarrange(p_1, p_2, p_3, nrow = 3, ncol = 1)
Plot Words on a Scatterplot
Plot a set of words by their length and frequency, and add labels for the words at the extremes.
library(ggrepel) ggplot(d, aes(x = Length, y = Frequency, label = Word)) + geom_point() + geom_label_repel(data = subset(d,(abs(Length) >1 & abs(Frequency) > 1)))