editing out the question to remove now that it's been answered
CodePudding user response:
An option would be rotation the labels of your x-axis using las = 2
. I created some extra random labels to give you a reproducible example. First a before plot:
df <- data.frame(Department_lower=sample(c('labelA', 'entrees', 'salad', 'labelB', 'general', 'catering', 'swag', 'labelC', 'labelD'),
50, replace=TRUE))
plot <- barplot(sort(table(df$Department_lower), decreasing=TRUE))
Before:
Rotating x-axis labels:
plot <- barplot(sort(table(df$Department_lower), decreasing=TRUE), las = 2)
Output: