我想在堆积条形图中添加 % 标签。这是我的数据。
discipline <- c("Physician", "Social Worker", "NP/PA", "Case Manager", "Nurse", "Pharmacist", "Administrative"))
variable <- c("aware", "confident", "issue", "scope", "concerned", "access"))
response <- c("N/A", "Strongly Agree", "Agree", "Neutral", "Disagree", "Strongly Disagree")
Data <- data.frame(discipline, variable, response)
这是我的代码,没有标签。
ggplot(incorporation)+
geom_bar(aes(fill = response, x = (..count..)/sum(..count..),
y = factor(reorder(variable,desc(response))),),
position = "fill")+
theme(axis.text.x = element_text(angle = -90, hjust = 0),
axis.title.y = element_blank(),
axis.title.x = element_blank())+
scale_fill_brewer(palette = "RdYlGn", direction = -1)+
scale_x_continuous(labels = scales::percent)