This question already has an answer here:
- rotating axis labels in R 5 answers
I have the following code that is plotting a barplot in R
barplot(prop.table(table(topPerforming$Category))) #before
theTable <- within(topPerforming,Category <- factor(Category, levels=names(sort(table(Category),decreasing=TRUE))))
#theTable ---- new table created in which Category is sorted in decreasing manner.
#topPerforming ---- name of the old table.
#Category ---- column name
#levels thing used to sort the names in the decreasing manner.
barplot(prop.table(table(theTable$Category)))
but the output plot i can only see 6 categories as they are overlapping each other (horizontally). I have tried las=2 as seen in similar questions on this but i keep getting errors.