You can isolate the desired labels in a new dataframe and use another geom_text()
:
library(ggplot2)
#Data for new labels
Labels <- subset(CRM_df_2,rework_status=='No Rework')
Labels <- Labels[Labels$percent!=0,]
Labels$y <- c(15,37,46,31)
#Plot
ggplot(CRM_df_2, aes(q_year, count, fill = rework_status)) +
geom_bar(stat = "identity", color = "black", width = 1) +
geom_text(aes(label= count),
position=position_stack(0.5), size = 6, color = "black") +
geom_text(data=Labels,aes(x=q_year,y=y,label=percent))+
facet_wrap(.~quarter,scales='free_x',nrow = 1,strip.position = 'bottom')+
theme(strip.text = element_blank(),
strip.placement = 'outside',
legend.position = "bottom",
legend.title = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.title = element_text(hjust = 0.5),
legend.spacing.x = unit(1.5, 'cm'))+
labs(title = "CRM First Pass Yield") +
scale_fill_manual(values = c("No Rework" = "yellowgreen",
"Content Rework" = "royalblue",
"CO Rework" = "steelblue1"))
Output:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…