Im trying to make a ggplot of a factor column and I want the plot to start from decreasing order of the highest count. I sorted my data before I plotted, but I still get the plot like this. Could someone please let me know how I can get a cleaner plot?
library(viridis)
library(ggplot2)
library(tidyverse)
phenotype <- data.frame (table(tiering$Phenotype))
phenotype <- phenotype %>% rename(Phenotype = Varl, Total = Freg)
phenotype <- phenotype[order(phenotype$Total, decreasing = TRUE) ,]
P <- ggplot(phenotype, aes(Phenotype, Total, fill = Total)) + geom_col() + geom_text(aes(label = Total), vjust= +0.3, size = 3.5) + theme classic() + ggtitle("Main phenotypes stated") +
scale_fill_viridis(option = "viridis")