如何在R中仅更改堆叠条的特定部分的颜色?

如何在R中仅更改堆叠条的特定部分的颜色?,r,boxplot,stacked-chart,R,Boxplot,Stacked Chart,我有一个关于只在堆叠条的某些部分提供颜色的问题 Genotype <- c(rep("CV_A",3), rep("CV_B",3), rep("CV_A",3), rep("CV_B",3)) treatment <- c("CTRL", "BT", "AN","CTRL", "BT", "AN

我有一个关于只在堆叠条的某些部分提供颜色的问题

Genotype <- c(rep("CV_A",3), rep("CV_B",3), rep("CV_A",3), rep("CV_B",3))
treatment <- c("CTRL", "BT", "AN","CTRL", "BT", "AN","CTRL", "BT", "AN","CTRL", "BT", "AN")
ratio <- c(rep("x", 6), rep("y",6))
value <- c(1, 0.81,1,0.99,0.71,0.94,0.17,0.18,0.15,0.009,0.28,0.05)
dataA <- data.frame (Genotype, treatment, ratio, value)

ggplot(data=dataA, aes(x=treatment, y=value, fill=ratio))+
  geom_bar(stat="identity", position = position_stack(reverse = T), width = 0.7, size=1) + 
  geom_hline(yintercept=1, linetype="solid", color = "Blue") +
  scale_fill_manual(values= c ("DarkSlateGray", "dark red")) +
  scale_y_continuous(breaks = seq(0,1.5,0.3), limits = c(0,1.5)) +
  facet_wrap(~Genotype)
基因型