Hello i'm having trouble here. I want to label a one-column barplot and the labels appear join together, i want them to be in their respective colour. Here's the code:
set.seed(983274) #Reproducing my data
data <- data.frame(x = sample(LETTERS[1:5], 100, replace = TRUE))
data_2 <- as.data.frame(prop.table(table(data$x))*100) #percentage data table
ggplot(data_srz, aes(x = "", y = Freq, fill = Var1)) + # Plot with values on top
geom_bar(stat = "identity", width = 0.2) +
geom_text(aes(label = paste0(Freq, "%"))) +
coord_flip()
This is my current graphic:
Thanks stack community , i've been stack in this for hours. Help.